1
0
Fork 0
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:
Jason Hall 2025-07-27 17:14:13 -04:00
parent e5071fc0cf
commit 9eaff0dc42
Failed to extract signature

View file

@ -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)
}