mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Add: JSON marshal error failure checking; Fix: formatting
This commit is contained in:
parent
232da60430
commit
9ed55bc520
@ -17,11 +17,11 @@ limitations under the License.
|
|||||||
package apimachinery
|
package apimachinery
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"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"
|
||||||
@ -259,9 +259,10 @@ var _ = SIGDescribe("Namespaces [Serial]", func() {
|
|||||||
ginkgo.By("patching the Namespace")
|
ginkgo.By("patching the Namespace")
|
||||||
nspatch, err := json.Marshal(map[string]interface{}{
|
nspatch, err := json.Marshal(map[string]interface{}{
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"labels": map[string]string{"testLabel":"testValue"},
|
"labels": map[string]string{"testLabel": "testValue"},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
framework.ExpectNoError(err, "failed to marshal JSON patch data")
|
||||||
_, 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