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

fixed pdbMinAvailableGreaterThanHPAMinReplicas and added validation for pdbMinAvailableEqualToHPAMinReplicas. #1073

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

YuMuuu
Copy link

@YuMuuu YuMuuu commented Oct 3, 2024

This PR fixes #1071

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

What changes did you make?

What alternative solution should we consider, if any?

  • I couldn't connect to circle ci for some reason so I ran test local only/

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2024

CLA assistant check
All committers have signed the CLA.

@vitorvezani
Copy link
Member

Hi @YuMuuu, thanks for your contribution!

After reviewing the changes and discussing internally, we believe this update introduces a breaking change. To avoid impacting current Polaris clients, we suggest the following approach:

  • Retain the current check, but modify its logic (and docs) to check only for >, instead
  • Introduce a complementary check that specifically handles the = case.

Both changes we plan to release in a new minor version.
This approach ensures compatibility with existing clients while addressing the functionality you're aiming for.

I understand this may require additional changes to your PR. Please let me know if you have the bandwidth to make these adjustments, or if you'd prefer someone else to take it from here.

Thanks again for your efforts!

@YuMuuu YuMuuu marked this pull request as ready for review October 3, 2024 20:09
@YuMuuu
Copy link
Author

YuMuuu commented Oct 4, 2024

@vitorvezani
Thanks for your reply. I agree with your idea. I’ll keep the name pdbMinAvailableGreaterThanHPAMinReplicas, fix logic, and create other complement validation.
I’d like to fix the PR as you mentioned, but it might take time because I’m not a golang expert.

YuMuuu added 3 commits October 4, 2024 09:50
This reverts commit faffffc.
…lableGreaterThanOrEqualToHPAMinReplicas"

This reverts commit b93f283.
@YuMuuu YuMuuu force-pushed the rename-pdbMinAvailableGreaterThanHPAMinReplicas branch from 79628dc to 94863f3 Compare October 4, 2024 01:19
@YuMuuu YuMuuu force-pushed the rename-pdbMinAvailableGreaterThanHPAMinReplicas branch from 94863f3 to 701c6f0 Compare October 4, 2024 01:19
@YuMuuu YuMuuu changed the title rename pdbMinAvailableGreaterThanHPAMinReplicas to pdbMinAvailableGre… Draft: rename pdbMinAvailableGreaterThanHPAMinReplicas to pdbMinAvailableGre… Oct 4, 2024
@YuMuuu YuMuuu changed the title Draft: rename pdbMinAvailableGreaterThanHPAMinReplicas to pdbMinAvailableGre… fixed pdbMinAvailableGreaterThanHPAMinReplicas and added validation for pdbMinAvailableEqualToHPAMinReplicas. Oct 4, 2024
@YuMuuu
Copy link
Author

YuMuuu commented Oct 4, 2024

I made a logic fix to pdbMinAvailableGreaterThanHPAMinReplicas and added validation for pdbMinAvailableEqualToHPAMinReplicas.

The names of the validations and their specifications have been aligned; however, it was found that pdbMinAvailableGreaterThanHPAMinReplicas and pdbMinAvailableEqualToHPAMinReplicas exhibit conflicting behavior.

Specifically, the following cases are now allowed under pdbMinAvailableEqualToHPAMinReplicas:

test/checks/pdbMinAvailableEqualToHPAMinReplicas/success-gt-percent.yaml

  • minAvailable: 15
  • minReplicas: 10

test/checks/pdbMinAvailableEqualToHPAMinReplicas/success-gt-scalar.yaml

  • minAvailable: 10
  • minReplicas: 5

These configurations are clearly incorrect. While applying both pdbMinAvailableGreaterThanHPAMinReplicas and pdbMinAvailableEqualToHPAMinReplicas together resolves the issue, using only pdbMinAvailableEqualToHPAMinReplicas could allow such incorrect configurations. Is this behavior acceptable?

@vitorvezani
Copy link
Member

I believe this approach is acceptable, as it avoids triggering two policies for the same underlying issue. With both checks enabled by default, we can ensure all cases are covered.

Let me know if you have any thoughts or concerns, @sudermanjr

@YuMuuu
Copy link
Author

YuMuuu commented Oct 5, 2024

@vitorvezani @sudermanjr
Releasing it in the following order might be better I guess:

  1. change the logic of pdbMinAvailableGreaterThanHPAMinReplicas and create new pdbMinAvailableGreaterThanOrEsualToHPAMinReplicas
  2. deprecate the pdbMinAvailableGreaterThanHPAMinReplicas
  3. delete pdbMinAvailableGreaterThanHPAMinReplicas <- next major version

What do you think?

@vitorvezani
Copy link
Member

That's a valid approach as well. However, I see a potential issue during the first release: whereas if pdbMinAvailable > HPAMinReplicas, it would trigger both checks simultaneously.
I also think that a breaking change for this is a bit too much, having 2 similar checks that are mutually-exclusive sounds reasonable (although not perfect).

I'll discuss both options with Andy when he's back from his time off and keep you updated.

@YuMuuu
Copy link
Author

YuMuuu commented Nov 19, 2024

Is Andy on a long vacation?

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.

pdbMinAvailableGreaterThanHPAMinReplicas validation is actually a greater or equal then comparison
3 participants