-
Notifications
You must be signed in to change notification settings - Fork 45
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
chart: bugfix for bypassSecrets #532
chart: bugfix for bypassSecrets #532
Conversation
@@ -166,7 +166,7 @@ spec: | |||
value: "{{ .Values.config.auth.github.enterpriseURL }}" | |||
{{- end }} | |||
{{- end }} | |||
{{- if eq .Values.config.auth.mode "oidc" }} | |||
{{- if and (eq .Values.config.auth.mode "oidc") (ne .Values.config.auth.bypassSecrets true) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ne .Values.config.auth.bypassSecrets true
check should be applied for the eq .Values.config.auth.mode "github"
case also. It will be better to nest the auth related conditions inside ne .Values.config.auth.bypassSecrets true
condition
Aah, good catch. Left a comment. |
6c9cf99
to
23517e0
Compare
As This simplifies the logic a bit, hope you like it. Here are the permutations I've tested with this update, omitting the entire file outputs and including only if secrets is generated (for brevity): default case
As expected, no secrets are generated, because the deployment mounts what the subchart creates, and no auth is setup postgresExistingSecret disabled and password set instead
secret populated with set password as expected oidc enabled
oidc secrets passed through as expected, deployment mounts look good:
oidc secrets supplied
As expected, Only subchart secret created. The appropriate mount is supplied to the deployment to match the new key
|
23517e0
to
4899fff
Compare
Hey, |
Not to contradict, but its a pattern, not a tailor made solution, it can be applied to both. Would you like me to also add the pattern for |
Yes, please. let's also add it to |
For consistency, here are the same checks for the default
github enabled
github secrets supplied
|
cb0eba3
to
533c211
Compare
@yolossn what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally by generating the template files for both oidc
and github
. Thanks for providing detailed cases in the PR comments. Just a small change in the README file. After that, we should be good to go.
@goshlanguage Few nitpicks and then we should be good to go. Sorry I missed them earlier. Please combine the suggestion commits into one. |
Why not just enable squash commits on the repo? It's not the best developer experience imo. |
…bled, the secret for oidc is no longer created, but its mount in the deployment still exists. This commit also drops the `bypassSecrets` value in favor of adding an `existingSecrets` field to the `config.auth.oidc` and `config.auth.github` maps, and updates logic for those.
c1a3ef1
to
74d12ef
Compare
Sorry for the inconvenience, I'll discuss this with the team. |
No worries, just a suggestion, as the end result would be the same. Downside being of course, you'd have to trust the collaborators to follow guidelines, so that's not always realistic unfortunately. Thanks for working with me on this @yolossn |
Hey @goshlanguage , thanks for this nice change! In your case it'd not happen because it was a single commit but I do prefer a closer alignment with contributors because maybe they made an effort on the commit title/body and wouldn't be fair to to see it changed when squashing. So we'll keep an eye on whether this option makes sense in the future. Cheers, and we hope to see more contributions from you. 🍻 |
Fix bug introduced by #514
While #514 was tested using helm template, submitting the output to the API uncovered a bit of a logical issue.
This bug surfaces when bypassSecrets is set to
true
. When oidc is enabled, the secret for oidc is no longer created due to bypassSecrets, however its mount in the deployment still exists. When these conditions are present, the deployment fails because it attempts the mount the secret, which is missing the keyoidcClientID
.How to use
Testing done
This time, I tested without bypassSecrets, and with bypassSecrets against a kind cluster locally