Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite resource updates due to canonical format conversion of resource requirements #2565

Conversation

Donnerbart
Copy link
Contributor

@Donnerbart Donnerbart commented Oct 28, 2024

Fixes #2509

Code coverage

  • Branch next
    image

  • Branch bugfix/2509-ssa-matcher-quantity/next
    image

@Donnerbart Donnerbart force-pushed the bugfix/2509-ssa-matcher-quantity/next branch 4 times, most recently from eae7969 to fc2de09 Compare October 28, 2024 17:56

static void sanitizeResourceRequirements(final Map<String, Object> actualMap,
final PodTemplateSpec actualTemplate, final PodTemplateSpec desiredTemplate) {
if (actualTemplate == null || desiredTemplate == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% sure if all of these null checks are needed. I've added them for all fields that have no default value in their declaration.

Copy link
Collaborator

@csviri csviri left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me, just made some really minor. comments.
In future maybe we could have sanitizers customizable, like have the ability to pass only few sanitizers if there will be more.

Thank you @Donnerbart !!

@csviri
Copy link
Collaborator

csviri commented Nov 6, 2024

I guess this needs a rebase. Sorry I'm on out this and partially next week. @metacosm from my side this PR can go in after rebase, pls review it also.

@Donnerbart Donnerbart force-pushed the bugfix/2509-ssa-matcher-quantity/next branch from 17e02d9 to 012f87b Compare November 6, 2024 04:51
@Donnerbart
Copy link
Contributor Author

Rebase is done.

@metacosm
Copy link
Collaborator

metacosm commented Nov 6, 2024

Sorry, I should have merged this before rebasing next. Apologies for the extra work that was bad scheduling on my part. 🙍

@Donnerbart
Copy link
Contributor Author

No worries, I'll rebase this as often as needed. I appreciate a lot how quickly you've looked into this contribution.

I've also created a backport for the main branch, if you agree that this should go into 4.9.x as well.

Copy link
Collaborator

@metacosm metacosm left a comment

Choose a reason for hiding this comment

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

Thank you!

@metacosm metacosm merged commit bad7c53 into operator-framework:next Nov 6, 2024
57 checks passed
@Donnerbart Donnerbart deleted the bugfix/2509-ssa-matcher-quantity/next branch November 6, 2024 08:20
metacosm pushed a commit that referenced this pull request Nov 6, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
csviri pushed a commit that referenced this pull request Nov 13, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
metacosm pushed a commit that referenced this pull request Nov 19, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
metacosm pushed a commit that referenced this pull request Nov 20, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
metacosm pushed a commit that referenced this pull request Nov 27, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
csviri pushed a commit that referenced this pull request Dec 6, 2024
…resource requirements (#2565)

* refactor: clean up SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* test: add missing tests for StatefulSet with VolumeClaimTemplates for SSABasedGenericKubernetesResourceMatcher

Signed-off-by: David Sondermann <[email protected]>

* fix: Fix infinite resource updates due to canonical format conversion of resource requirements

Signed-off-by: David Sondermann <[email protected]>

* test: Add test cases with init containers to ResourceRequirementsSanitizerTest

Signed-off-by: David Sondermann <[email protected]>

---------

Signed-off-by: David Sondermann <[email protected]>
Signed-off-by: Chris Laprun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants