mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Update: json patch generation
This commit is contained in:
parent
616003a8e9
commit
232da60430
@ -21,6 +21,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"encoding/json"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
@ -256,7 +257,11 @@ var _ = SIGDescribe("Namespaces [Serial]", func() {
|
||||
namespaceName = ns.ObjectMeta.Name
|
||||
|
||||
ginkgo.By("patching the Namespace")
|
||||
nspatch := `{"metadata":{"labels":{"testLabel":"testValue"}}}`
|
||||
nspatch, err := json.Marshal(map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"labels": map[string]string{"testLabel":"testValue"},
|
||||
},
|
||||
})
|
||||
_, err = f.ClientSet.CoreV1().Namespaces().Patch(namespaceName, types.StrategicMergePatchType, []byte(nspatch))
|
||||
framework.ExpectNoError(err, "failed to patch Namespace")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user