add support for overriding name of PDB#5090
Conversation
|
Yes, please move it into the _helpers.tpl file. 🙇 And then apply to all three pod distribution budget templates. |
Signed-off-by: Meg Ashby <meg@alloy.com>
…Controller pdbs Signed-off-by: Meg Ashby <meg@alloy.com>
c38d2f4 to
e1f5c51
Compare
| {{- end -}} | ||
|
|
||
| {{- define "external-secrets.pdbName" -}} | ||
| {{- .Values.podDisruptionBudget.nameOverride | default (printf "%s-pdb" (include "external-secrets.fullname" .)) }} |
There was a problem hiding this comment.
This does not exist yet. nameOverride is not a thing in the values.yaml file. Make sure you create that first. :)
Then add a little test like this:
suite: test pod distribution budget deployment
templates:
- poddisruptionbudget.yaml
tests:
- it: should set podDisruptionBudget to set value if given
set:
podDisruptionBudget.nameOverride: MyCustomName
asserts:
- equal:
path: metadata.name
value: MyCustomNameOr something like that into a new file under deploy/charts/external-secrets/tests. And once you run make helm.test you should see your new test there. And then make it fail by setting something different for MyCustonName and that should give you some confidence as to what you wrote is actually working. :)
There was a problem hiding this comment.
Thanks so much for the guidance, makes total sense. I will attach screenshots of local test output to the main thread of this PR to show they've passed.
Signed-off-by: Meg Ashby <meg@alloy.com>
Signed-off-by: Meg Ashby <megashby@comcast.net>
Skarlso
left a comment
There was a problem hiding this comment.
Just one comment. This looks fantastic already. :) Thank you!
| {{/* | ||
| Create the name of the pod disruption budget to use in the webhook | ||
| */}} | ||
| {{- define "external-secrets.webookPdbName" -}} |
Signed-off-by: Meg Ashby <megashby@comcast.net>
Signed-off-by: Meg Ashby <megashby@comcast.net>
|
/ok-to-test sha=2f6a1de3b8b6a6106307c6fb66d6bbeb99bbaefd |
|
* add support for overriding name of PDB Signed-off-by: Meg Ashby <meg@alloy.com> * moving logic to _helpers.tpl, also making changes to webhook and certController pdbs Signed-off-by: Meg Ashby <meg@alloy.com> * add test cases for each pdb type, add in defaults to values.aml Signed-off-by: Meg Ashby <meg@alloy.com> * add docs Signed-off-by: Meg Ashby <meg@alloy.com> * Update _helpers.tpl Signed-off-by: Meg Ashby <megashby@comcast.net> * Update webhook-poddisruptionbudget.yaml Signed-off-by: Meg Ashby <megashby@comcast.net> --------- Signed-off-by: Meg Ashby <meg@alloy.com> Signed-off-by: Meg Ashby <megashby@comcast.net> Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>



Problem Statement
Reporter wanted a way to have more control over the naming convention of the PDB, and the previous logic of suffixing with
-pdbwas not sufficientRelated Issue
Fixes #5042
Proposed Changes
Allow overriding the name of the PodDisruptionValue , webhook PodDisruption Budget, and Cert controller pod disruption budgets by first checking for
.podDisruptionBudget.nameOverridebefore defaulting to original valuesChecklist
git commit --signoffmake testmake reviewable