-
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
Fix CRD upgrades #1819
Fix CRD upgrades #1819
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
5ddca96
to
0c2ef9c
Compare
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. |
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.
👍 nice getting the integration test in too
88c470a
to
17dcc7b
Compare
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. |
Previously, the provider attempted to update CRDs with the normal PATCH workflow (equivalent to `kubectl apply`). This process did not work for some CRDs. Rather than patching the existing CRD, the provider will now replace the old definition using a PUT operation (equivalent to `kubectl replace`). This fixes the cases where the PATCH operation failed, while still providing accurate previews and replacement semantics.
5a74717
to
fc9067e
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. |
@@ -95,6 +101,9 @@ type ProviderArgs struct { | |||
// BETA FEATURE - If present and set to true, enable server-side diff calculations. | |||
// This feature is in developer preview, and is disabled by default. | |||
EnableDryRun pulumi.BoolPtrInput | |||
// BETA FEATURE - If present and set to true, replace CRDs on update rather than patching. |
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.
Another thought is to perhaps signal the replacement behavior through an annotation instead? The advantage there would be that it might be more surgical while the provider level configuration is global and will apply to all CRD resources. As discussed offline, we can consider as a subsequent feature based on user feedback.
import * as k8s from "@pulumi/kubernetes"; | ||
|
||
const provider = new k8s.Provider("k8s", { | ||
enableReplaceCRD: 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.
Perhaps drop this in the initial step? Would be good to have exercised the scenario of updating the provider configs as part of the update.
func TestCRDUpgrade(t *testing.T) { | ||
test := baseOptions.With(integration.ProgramTestOptions{ | ||
Dir: filepath.Join("crd-upgrade", "step1"), | ||
Quick: false, |
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.
Quick: false, | |
Quick: false, |
Remove this since its the default anyway?
test := baseOptions.With(integration.ProgramTestOptions{ | ||
Dir: filepath.Join("crd-upgrade", "step1"), | ||
Quick: false, | ||
ExpectRefreshChanges: 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.
Would be good to document what we expect to change when we set expectRefreshChanges
.
Oh, sorry. I missed the feedback when I refreshed the page. I'll follow up on any action items in another PR. Edit: #1827 |
Proposed changes
Previously, the provider attempted to update CRDs with the
normal PATCH workflow (equivalent to
kubectl apply
). Thisprocess did not work for some CRDs.
Rather than patching the existing CRD, the provider will now
replace the old definition using a PUT operation (equivalent to
kubectl replace
). This fixes the cases where the PATCHoperation failed, while still providing accurate previews and
replacement semantics.
Related issues (optional)
Fix #1293