-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40666 from ymqytw/support_generic_merge_patch
Automatic merge from submit-queue (batch tested with PRs 40864, 40666, 38382, 40874) apply falls back to generic JSON patch computation if no go struct is registered for the target GVK This PR is the master version of #40096 which is target 1.4 branch. This PR is based on #40260 - [x] ensure subkey deletion works in CreateThreeWayJSONMergePatch - [x] ensure type stomping works in CreateThreeWayJSONMergePatch - [x] lots of tests for generic json patch computation - [x] apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK - [x] prevent generic apply patch computation between different apiVersions and/or kinds - [x] make pruner generic (apply --prune works with TPR) ```release-note apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK ```
- Loading branch information
Showing
17 changed files
with
1,164 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: Bar | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 | ||
nestedField: | ||
someSubfield: modifiedSubfield | ||
newSubfield: subfield3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 | ||
nestedField: | ||
someSubfield: modifiedSubfield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 | ||
nestedField: | ||
someSubfield: modifiedSubfield | ||
otherSubfield: subfield2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 | ||
nestedField: | ||
someSubfield: subfield1 | ||
otherSubfield: subfield2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField | ||
newField: field3 | ||
- kind: Bar | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField | ||
newField: field3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField | ||
- kind: Bar | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField | ||
otherField: field2 | ||
- kind: Bar | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: modifiedField | ||
otherField: field2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- kind: Foo | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 | ||
- kind: Bar | ||
apiVersion: company.com/v1 | ||
metadata: | ||
name: test-list | ||
labels: | ||
pruneGroup: "true" | ||
someField: field1 | ||
otherField: field2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.