Skip to content
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

Fallback to JSON merge if strategic merge fails #622

Merged
merged 2 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
desired and actual state during a Pulumi update. (https://github.com/pulumi/pulumi-kubernetes/pull/618).
- Refactor Pod await logic for easier testing and maintenance (https://github.com/pulumi/pulumi-kubernetes/pull/590).
- Update to client-go v12.0.0 (https://github.com/pulumi/pulumi-kubernetes/pull/621).
- Fallback to JSON merge if strategic merge fails (https://github.com/pulumi/pulumi-kubernetes/pull/622).

### Bug fixes

Expand Down
6 changes: 5 additions & 1 deletion pkg/openapi/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ func PatchForResourceUpdate(client discovery.CachedDiscoveryInterface, lastSubmi
if resSchema := resources.LookupResource(gvk); resSchema != nil {
glog.V(1).Infof("Attempting to update '%s' '%s/%s' with strategic merge",
gvk.String(), lastSubmitted.GetNamespace(), lastSubmitted.GetName())
return strategicMergePatch(gvk, resSchema, lastSubmittedJSON, currentSubmittedJSON, liveOldJSON)
patch, patchType, lookupPatchMeta, err := strategicMergePatch(
gvk, resSchema, lastSubmittedJSON, currentSubmittedJSON, liveOldJSON)
if err == nil {
return patch, patchType, lookupPatchMeta, nil
}
}

// Fall back to three-way JSON merge patch.
Expand Down