mirror of
https://github.com/imjasonh/client-go2
synced 2026-07-18 22:58:43 +00:00
simplify patch
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
e5071fc0cf
commit
9eaff0dc42
1 changed files with 1 additions and 13 deletions
|
|
@ -505,19 +505,7 @@ func TestPatch(t *testing.T) {
|
|||
}
|
||||
|
||||
// Create a JSON patch
|
||||
patch := []map[string]interface{}{
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/metadata/labels/environment",
|
||||
"value": "production",
|
||||
},
|
||||
}
|
||||
|
||||
patchData, err := json.Marshal(patch)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
patchData := []byte(`{"op": "add", "path": "/metadata/labels/environment", "value": "production"}`)
|
||||
if err := client.Patch(ctx, namespace, "patch-pod", types.JSONPatchType, patchData, nil); err != nil {
|
||||
t.Fatalf("Patch failed: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue