-
Notifications
You must be signed in to change notification settings - Fork 117
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 configmaps as mutable #1926
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
1 similar comment
Does the PR have any schema changes?Looking good! No breaking changes found. |
The implementation looks fine, but I'm concerned about two things with this change:
I'd be ok gating the behavior change behind an opt-in provider flag, but wonder if we'd want to explicitly tie it to the |
Yes, I had the same impression. Perhaps I am missing something obvious here though. Based on my reading of pulumi/pulumi#7226 there is no way currently to undo the replacement (marking replaceOnChanges undefined etc.) as you suggested in pulumi/pulumi#9158 (comment). So sounds like regardless, we would have to flip the default interpretation of configMaps from being immutable to mutable to address this problem.
I am fine with the latter approach which I alluded to above as well (use replaceOnChanges to trigger replacement instead of |
It looks like the mergeOpts function should support overriding something specified in the SDK. i.e., if the SDK has
Good point; I hadn't considered that. My first thought is that we could check the engine version at runtime, but I'm not sure if the provider has access to that information. That would be good to find out if that's a possibility.
Let's try the provider flag approach and see how that looks. We could flip the default replacement behavior for both ConfigMap and Secret, and indicate how to use |
Yeah that sounds good! Will move forward with that approach. |
@lblackstone this is now ready for a review. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
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.
Implementation looks good. I don't see any SDK changes, so you'll need to make sure that you regenerate those as well with the schema changes.
Co-authored-by: Levi Blackstone <levi@pulumi.com>
Co-authored-by: Levi Blackstone <levi@pulumi.com>
Co-authored-by: Levi Blackstone <levi@pulumi.com>
Co-authored-by: Levi Blackstone <levi@pulumi.com>
Does the PR have any schema changes?Looking good! No breaking changes found. |
3 similar comments
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
Hi, I applied the flag for cm and it works as expected, but there is no comparable workaround for secrets Thank you! |
I opened #2291 to track the option for Secrets. |
This introduces the flag `enableSecretMutable` which does for `Secret`s what the existing `enableConfigMapMutable` flag does for `ConfigMap`s. See #1926 for the motivation for this flag. Changes to the `type` field will still trigger a replacement as this field is immutable. Fixes #2291. Fixes #3181. --------- Co-authored-by: Bryce Lampe <bryce@pulumi.com>
Proposed changes
This is a workaround for configmap in particular while #1775 awaits some additional support from the schema (pulumi/pulumi#9158)
Enabling the
enableConfigMapMutable
flag will treat configmaps as mutable - i.e. convert what would previously be a replacement to an update when mutated. If the provider flag is enabled, the previous behavior can be opted-in on a resource by resource basis by specifying thereplaceOnChanges: [*]
option. If the flag is not enabled (default), existing replacement behavior would be retained.Related issues (optional)
Fixes #1847