-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add option to treat secrets as mutable #3164
Add option to treat secrets as mutable #3164
Conversation
PR is now waiting for a maintainer to run the acceptance tests. |
9f88514
to
4deb10c
Compare
PR is now waiting for a maintainer to run the acceptance tests. |
/run-acceptance-tests |
Please view the PR build: https://github.com/pulumi/pulumi-kubernetes/actions/runs/10424850378 |
Thank you for the contribution! A couple test failures but looks reasonable overall. We'll review this as a team next week.
|
4deb10c
to
30cc20b
Compare
PR is now waiting for a maintainer to run the acceptance tests. |
This does for `Secret`s what the existing `enableConfigMapMutable` flag does for `ConfigMap`s.
30cc20b
to
4001e00
Compare
PR is now waiting for a maintainer to run the acceptance tests. |
Fixed! One of those was some sloppy copy-pasting in the test itself, the other was an actual logic error that I introduced when I re-marked the |
PR is now waiting for a maintainer to run the acceptance tests. |
/run-acceptance-tests |
Please view the PR build: https://github.com/pulumi/pulumi-kubernetes/actions/runs/10459235903 |
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.
LGTM - thanks for the PR!
provider/pkg/provider/diff.go
Outdated
if clients.IsSecret(obj) && !k.enableSecretMutable { | ||
props = append(props, properties{".type", ".stringData", ".data"}...) | ||
} else if kindFields, kindExists := version[gvk.Kind]; kindExists { |
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.
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.
That makes sense, yeah, it's not like trying to treat it as mutable will even work in that case. The same applies to ConfigMap
s though, right? I don't think those handle that either right now, that's what I based this code on after all.
I can make a change to handle that, should I also make the same change for ConfigMap
s while I'm at it?
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.
I've made the change for this for both Secret
s and ConfigMap
s. I put the change for the ConfigMap
s in a separate commit because I wasn't sure whether you wanted that one, so you can just get rid of that commit if you don't.
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.
@MaienM thank you again for the great contribution! I'm very happy this prompted us to uncover the immutable
incompatibility and that you were able to fix it while you were in here. I added an E2E test case partly as a sanity check and party to cement the behavior we expect here.
So much has changed with Pulumi and k8s since this behavior was originally introduced that it would make much more sense IMO to make this the default behavior at some point in the future (#3179). I added a note to the changelog to that effect, since it's a potentially disruptive behavioral change.
After I merge this it will be available as a pre-release if you'd like to play around with it.
PR is now waiting for a maintainer to run the acceptance tests. |
PR is now waiting for a maintainer to run the acceptance tests. |
5d5621e
to
9affcae
Compare
PR is now waiting for a maintainer to run the acceptance tests. |
9affcae
to
278cc10
Compare
PR is now waiting for a maintainer to run the acceptance tests. |
/run-acceptance-tests |
Please view the PR build: https://github.com/pulumi/pulumi-kubernetes/actions/runs/10494552504 |
Proposed changes
This introduces the flag
enableSecretMutable
which does forSecret
s what the existingenableConfigMapMutable
flag does forConfigMap
s. See #1926 for the motivation for this flag. Changes to thetype
field will still trigger a replacement as this field is immutable.Related issues (optional)
Fixes #2291.
Fixes #3181.