You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r.recorder.Eventf(in.cluster, corev1.EventTypeNormal, createEventReason, "Created %q as a replacement for %q (template rotation)", tlog.KObj{Obj: in.desired}, in.ref.Name)
Message: "DockerMachineTemplate.infrastructure.cluster.x-k8s.io \"docker-template-one\" is invalid: spec.template.spec.preLoadImages: Invalid value: \"array\": spec.template.spec.preLoadImages in body must be of type string: \"array\"",
2093
+
Details: &metav1.StatusDetails{
2094
+
Group: "infrastructure.cluster.x-k8s.io",
2095
+
Kind: "DockerMachineTemplate",
2096
+
Name: "docker-template-one",
2097
+
Causes: []metav1.StatusCause{
2098
+
{
2099
+
Type: "FieldValueInvalid",
2100
+
Message: "Invalid value: \"array\": spec.template.spec.preLoadImages in body must be of type string: \"array\"",
2101
+
Field: "spec.template.spec.preLoadImages",
2102
+
},
2103
+
},
2104
+
},
2105
+
}}
2106
+
wantError:=&apierrors.StatusError{
2107
+
ErrStatus: metav1.Status{
2108
+
Status: metav1.StatusFailure,
2109
+
Code: http.StatusUnprocessableEntity,
2110
+
Reason: metav1.StatusReasonInvalid,
2111
+
// The only difference between the two objects should be in the Message section.
2112
+
Message: "failed to create DockerMachineTemplate.infrastructure.cluster.x-k8s.io: FieldValueInvalid: spec.template.spec.preLoadImages: Invalid value: \"array\": spec.template.spec.preLoadImages in body must be of type string: \"array\".",
2113
+
Details: &metav1.StatusDetails{
2114
+
Group: "infrastructure.cluster.x-k8s.io",
2115
+
Kind: "DockerMachineTemplate",
2116
+
Name: "docker-template-one",
2117
+
Causes: []metav1.StatusCause{
2118
+
{
2119
+
Type: "FieldValueInvalid",
2120
+
Message: "Invalid value: \"array\": spec.template.spec.preLoadImages in body must be of type string: \"array\"",
2121
+
Field: "spec.template.spec.preLoadImages",
2122
+
},
2123
+
},
2124
+
},
2125
+
},
2126
+
}
2127
+
t.Run("Transform a create error correctly", func(t*testing.T) {
0 commit comments