From f87bcd9b3a8166acb62e3f39e207bda3673f0ed6 Mon Sep 17 00:00:00 2001 From: Mariam Fahmy Date: Tue, 19 Nov 2024 15:42:29 +0200 Subject: [PATCH] fix: remove duplicated unit tests in JSONPatch and ApplyConfiguration Signed-off-by: Mariam Fahmy --- .../policy/mutating/patch/json_patch_test.go | 10 ------- .../plugin/policy/mutating/patch/smd_test.go | 29 ------------------- 2 files changed, 39 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch_test.go index c01b2d3cf50..121ff4bba6d 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch_test.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch_test.go @@ -46,16 +46,6 @@ func TestJSONPatch(t *testing.T) { expectedResult runtime.Object expectedErr string }{ - { - name: "jsonPatch with false test operation", - expression: `[ - JSONPatch{op: "test", path: "/spec/replicas", value: 100}, - JSONPatch{op: "replace", path: "/spec/replicas", value: 3}, - ]`, - gvr: deploymentGVR, - object: &appsv1.Deployment{Spec: appsv1.DeploymentSpec{Replicas: ptr.To[int32](1)}}, - expectedResult: &appsv1.Deployment{Spec: appsv1.DeploymentSpec{Replicas: ptr.To[int32](1)}}, - }, { name: "jsonPatch with false test operation", expression: `[ diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd_test.go index 5fdae77a468..9ad483b3c69 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd_test.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd_test.go @@ -51,35 +51,6 @@ func TestApplyConfiguration(t *testing.T) { expectedResult runtime.Object expectedErr string }{ - { - name: "apply configuration add to listType=map", - expression: `Object{ - spec: Object.spec{ - template: Object.spec.template{ - spec: Object.spec.template.spec{ - volumes: [Object.spec.template.spec.volumes{ - name: "y" - }] - } - } - } - }`, - gvr: deploymentGVR, - object: &appsv1.Deployment{Spec: appsv1.DeploymentSpec{ - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Volumes: []corev1.Volume{{Name: "x"}}, - }, - }, - }}, - expectedResult: &appsv1.Deployment{Spec: appsv1.DeploymentSpec{ - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Volumes: []corev1.Volume{{Name: "x"}, {Name: "y"}}, - }, - }, - }}, - }, { name: "apply configuration add to listType=map", expression: `Object{