Skip to content

fix: Chart: Allow percentage on PDBs#4852

Merged
Skarlso merged 4 commits intoexternal-secrets:mainfrom
achetronic:fix/allow-percentage-pdbs
Jun 4, 2025
Merged

fix: Chart: Allow percentage on PDBs#4852
Skarlso merged 4 commits intoexternal-secrets:mainfrom
achetronic:fix/allow-percentage-pdbs

Conversation

@achetronic
Copy link
Copy Markdown
Contributor

Problem Statement

Chart is not allowing percentages on PodDisruptionBudget objects, which is in fact, the recommended way to express budgets

Related Issue

N/A

Proposed Changes

Instead of checking the type being an integer, with a string it's enough for both cases as chart is setting the value directly without any additional check

Checklist

  • I have read the contribution guidelines
  • All commits are signed with git commit --signoff
  • My changes have reasonable test coverage
  • All tests pass with make test
  • I ensured my PR is ready for review with make reviewable

Signed-off-by: Alby Hernández <donfumero@gmail.com>
@achetronic achetronic requested a review from a team as a code owner May 29, 2025 13:20
@achetronic achetronic requested a review from moolen May 29, 2025 13:20
@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 2, 2025

This will definitely break existing charts that use a number. 🤔 we have to be careful about this being released.

@achetronic
Copy link
Copy Markdown
Contributor Author

This will definitely break existing charts that use a number. 🤔 we have to be careful about this being released.

Agree with you, I think we need a big advice on this, but IMHO, feature is needed :)

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 2, 2025

Could you please update the tests?

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 2, 2025

Okay, so since existing deployments shouldn't be affected by this ( because the helm upgrade would just fail until values are updated ) we should be okay to release this with a minor version increase.

@achetronic
Copy link
Copy Markdown
Contributor Author

Okay, so since existing deployments shouldn't be affected by this ( because the helm upgrade would just fail until values are updated ) we should be okay to release this with a minor version increase.

This is the reason i did not those changes on the PR :)

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 2, 2025

they are still needed. :) I mean run make check-diff and commit the changes. :)

@achetronic
Copy link
Copy Markdown
Contributor Author

they are still needed. :) I mean run make check-diff and commit the changes. :)

Done, the branch is clean now. Thank you for the advise!

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 3, 2025

Great! Thank you. Now all you need to do is sign your last commit as well. :D And we're done. :)

Signed-off-by: Alby Hernández <donfumero@gmail.com>
@achetronic
Copy link
Copy Markdown
Contributor Author

Aaaaaand done! :)

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 3, 2025

@gusfcarvalho Are you okay to merge this? It will break helm upgrades. But there is no way around that. podDistributionBudget can indeed be defined as something like 50%.

@gusfcarvalho
Copy link
Copy Markdown
Member

This is just changing the defaults - from a buggy one. I thinks that's fine.

gusfcarvalho
gusfcarvalho previously approved these changes Jun 3, 2025
@gusfcarvalho
Copy link
Copy Markdown
Member

we are already planning the next release to be 0.18.0 anyways - we just need to add that as a breaking change to release notes.

@gusfcarvalho gusfcarvalho added the breaking-change This pull request introduces a breaking change label Jun 3, 2025
@gusfcarvalho
Copy link
Copy Markdown
Member

just labeled it so we can filter it down 😄

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 3, 2025

What do you mean it's changing the defaults? It's literally changing the json schema.

@gusfcarvalho
Copy link
Copy Markdown
Member

Although it is changing the schema, it’s not changing how yaml will process it for kubernetes afterwards (the simple fact that minAvailable: 1 worked even though we marked it as an integer is the proof of it). The only breaking change IMO would be people consuming from the schemas, no? 🙂

@gusfcarvalho
Copy link
Copy Markdown
Member

Furthermore, our policy for breaking changes does not include helm charts 😜😜

@k3rnelpan1c-dev
Copy link
Copy Markdown

@gusfcarvalho Are you okay to merge this? It will break helm upgrades. But there is no way around that. podDistributionBudget can indeed be defined as something like 50%.

I appologice for the drive by comment, but you can configure JSON Schemas to allow 2 different Types for a property1, so in theory, you could allow both.

i.e. The following allows for both Integers and strings as valid input.

"minAvailable": {
  "type": ["integer", "string"]
}

The only thing that might be a blocker is any generation scripts used to update the readme or other bits.

Footnotes

  1. https://json-schema.org/understanding-json-schema/reference/type

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 4, 2025

If a schema file is defined that file will be used to validate the values file for any upgrade install template and lint commands.

That's why there has to be a change in our values yaml file as well. Helm lint was failing. Meaning if we release this it will break the helm upgrade command people are running in a ci. The opt out is to run it with disable validation or something like that.

The only breaking change IMO would be people consuming from the schemas, no?

If the schemas file is there you use it automatically.

Anyways. I like that you can define both. That could work better. WDYT @achetronic?

@gusfcarvalho
Copy link
Copy Markdown
Member

If a schema file is defined that file will be used to validate the values file for any upgrade install template and lint commands.

That's why there has to be a change in our values yaml file as well. Helm lint was failing. Meaning if we release this it will break the helm upgrade command people are running in a ci.

yeah, that’s why this would be a breaking change. I’m not saying it isn’t going to be, just that the impact is limited to quote whatever the values users bring that are not compliant. I wouldn’t see a problem with it on a minor release, that was my point.

in any case the double type validation is a much better approach 🙂🙂

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 4, 2025

@gusfcarvalho Oh okay, gotcha. Sorry, I misunderstood you. 🙇

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 4, 2025

Thanks :)

Skarlso
Skarlso previously approved these changes Jun 4, 2025
@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 4, 2025

Ah sorry, you need to run make check-diff again. :D

enabled: false
minAvailable: 1
# maxUnavailable: 1
minAvailable: 1 # @schema type:[integer, string]
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.

try putting this on the TOP of this line. Then it should be okay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Skarlso Hello there :) those annotations only works when they are in the side. When putting them on top, not working at all

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.

Ugh, thought so. Was worth a try. Not sure what to do about the linter. Maybe just add a space or something? Can you fiddle with what the linter wants locally?

Copy link
Copy Markdown
Contributor Author

@achetronic achetronic Jun 4, 2025

Choose a reason for hiding this comment

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

Because of fixing this and TOCs i added exactly 4 spaces :) is it fine?

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.

Fine for me if the linter doesn't complain and it's still working. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

unit tests failing, but I think it doesn't matter for the purpose of this changes as no merging code, right? :)

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 4, 2025

Ya, I "fixed" the unit test. Sorry about that.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Jun 4, 2025

@Skarlso Skarlso merged commit a073150 into external-secrets:main Jun 4, 2025
23 checks passed
@achetronic
Copy link
Copy Markdown
Contributor Author

Ya, I "fixed" the unit test. Sorry about that.

Thank you! I assume this will be released in v0.17.1, right?

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 5, 2025

0.18.0. :)

Not because of this most likely, but we have other things in the pipeline I believe that might be breaking changes.

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Jun 5, 2025

Regardless, whatever comes next, this will be in it. :D

pepordev pushed a commit to pepordev/external-secrets that referenced this pull request Jun 11, 2025
* fix: Chart: Allow percentage on PDBs

Signed-off-by: Alby Hernández <donfumero@gmail.com>

* fix: populate changes

Signed-off-by: Alby Hernández <donfumero@gmail.com>

* fix: Use double type validation for chart values

Signed-off-by: Alby Hernández <donfumero@gmail.com>

---------

Signed-off-by: Alby Hernández <donfumero@gmail.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Pedro Parra Ortega <pedro.parraortega@enreach.com>
alliseeisgold pushed a commit to alliseeisgold/external-secrets that referenced this pull request Jul 10, 2025
* fix: Chart: Allow percentage on PDBs

Signed-off-by: Alby Hernández <donfumero@gmail.com>

* fix: populate changes

Signed-off-by: Alby Hernández <donfumero@gmail.com>

* fix: Use double type validation for chart values

Signed-off-by: Alby Hernández <donfumero@gmail.com>

---------

Signed-off-by: Alby Hernández <donfumero@gmail.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: asrormirzoev <asrormirzoev@yandex-team.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This pull request introduces a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants