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