Last active
March 5, 2018 21:49
-
-
Save nrb/9c1bccee36f9d16cce8cf06d6ec9c477 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | |
| "k8s.io/apimachinery/pkg/util/strategicpatch" | |
| ) | |
| func main() { | |
| one := unstructured.Unstructured{Object: map[string]interface{}{ | |
| "key": "value1", | |
| }} | |
| two := unstructured.Unstructured{Object: map[string]interface{}{ | |
| "key": "value2", | |
| }} | |
| fmt.Println("one :", one) | |
| fmt.Println("two: ", two) | |
| patch, _ := strategicpatch.CreateTwoWayMergeMapPatch(one.Object, two.Object, unstructured.Unstructured{}) | |
| fmt.Println("patch: %v", patch) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment