mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
Merge pull request #128862 from MariamFahmy98/map-unit-tests
fix: remove duplicated unit tests in JSONPatch and ApplyConfiguration
This commit is contained in:
commit
43f50b4e51
@ -46,16 +46,6 @@ func TestJSONPatch(t *testing.T) {
|
|||||||
expectedResult runtime.Object
|
expectedResult runtime.Object
|
||||||
expectedErr string
|
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",
|
name: "jsonPatch with false test operation",
|
||||||
expression: `[
|
expression: `[
|
||||||
|
@ -51,35 +51,6 @@ func TestApplyConfiguration(t *testing.T) {
|
|||||||
expectedResult runtime.Object
|
expectedResult runtime.Object
|
||||||
expectedErr string
|
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",
|
name: "apply configuration add to listType=map",
|
||||||
expression: `Object{
|
expression: `Object{
|
||||||
|
Loading…
Reference in New Issue
Block a user