Skip to content

update wrong memory format in the flinkdeployment-cr.yaml#7585

Open
XiShanYongYe-Chang wants to merge 1 commit into
karmada-io:masterfrom
XiShanYongYe-Chang:update-wrong-memory-format
Open

update wrong memory format in the flinkdeployment-cr.yaml#7585
XiShanYongYe-Chang wants to merge 1 commit into
karmada-io:masterfrom
XiShanYongYe-Chang:update-wrong-memory-format

Conversation

@XiShanYongYe-Chang
Copy link
Copy Markdown
Member

@XiShanYongYe-Chang XiShanYongYe-Chang commented May 29, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The flinkdeployment-cr.yaml use 100m (milli-bytes) of memory. As noted, memory should be specified in realistic units like Mi (e.g., 100Mi / 100M) rather than milli-bytes (m), which represent fractional bytes and are not meaningful for memory in Kubernetes.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copilot AI review requested due to automatic review settings May 29, 2026 10:25
@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 29, 2026
@karmada-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xishanyongye-chang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an inconsistency in memory resource definitions within the project's E2E test manifests and corresponding test assertions. By standardizing memory units to 'Mi', the changes ensure that resource requests are correctly interpreted by the Kubernetes scheduler and match the expected behavior in the test suite.

Highlights

  • Memory Unit Correction: Updated memory resource specifications from 'm' (milli) to 'Mi' (mebibytes) to align with standard Kubernetes resource quantity formats.
  • Test Suite Alignment: Updated end-to-end test expectations in 'federatedresourcequota_test.go' and 'schedule_multi_template_test.go' to reflect the corrected memory units.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 29, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request corrects the memory resource units in several E2E test files and manifests, changing '100m' and '200m' to '100Mi' and '200Mi' to correctly represent mebibytes instead of millicores for memory. There are no review comments, and I have no feedback to provide.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.15%. Comparing base (80ff6e5) to head (5ab6b57).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7585      +/-   ##
==========================================
- Coverage   42.16%   42.15%   -0.01%     
==========================================
  Files         879      879              
  Lines       54731    54731              
==========================================
- Hits        23076    23074       -2     
- Misses      29911    29913       +2     
  Partials     1744     1744              
Flag Coverage Δ
unittests 42.15% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: changzhen <changzhen5@huawei.com>
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the update-wrong-memory-format branch from 60206c8 to 5ab6b57 Compare May 30, 2026 01:50
}))
actualCPU := component.ReplicaRequirements.ResourceRequest[corev1.ResourceCPU]
actualMemory := component.ReplicaRequirements.ResourceRequest[corev1.ResourceMemory]
gomega.Expect(actualCPU.Cmp(resource.MustParse(expectedCPU))).Should(gomega.Equal(0),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
gomega.Expect(actualCPU.Cmp(resource.MustParse(expectedCPU))).Should(gomega.Equal(0),
gomega.Expect(actualCPU.Equal(resource.MustParse(expectedCPU))).Should(gomega.BeTure,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cmp method and the Equal method both perform semantic comparisons (ignoring differences in internal formats), with the distinction lying in their return values. At the underlying level, both methods first convert the two Quantities into a unified numerical form before performing the comparison. Therefore, both approaches are correct in their implementation and have no fundamental difference.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're totally right. The Equal function is just a wrapper around q.Cmp(v) == 0, so both are fine with me. My only concern is that using Equal seems more common and easier to understand. This is just my suggestion, so feel free to take it or leave it.

@XiShanYongYe-Chang
Copy link
Copy Markdown
Member Author

/hold

@karmada-bot karmada-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants