Skip to content

Commit 483dc2f

Browse files
author
Slide
authored
Fix: StatefulSet get failed in validateWorkloadSpreadSpec (#1964) (#1965)
Signed-off-by: yechun <[email protected]>
1 parent 076d160 commit 483dc2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/webhook/workloadspread/validating/workloadspread_validation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func validateWorkloadSpreadSpec(h *WorkloadSpreadCreateUpdateHandler, obj *appsv
154154
allErrs = append(allErrs, field.Invalid(fldPath.Child("targetRef"), spec.TargetReference, "TargetReference is not valid for StatefulSet."))
155155
} else {
156156
set := &appsv1.StatefulSet{}
157-
if getErr := h.Client.Get(context.TODO(), client.ObjectKey{Name: spec.TargetReference.Name, Namespace: obj.Namespace}, workloadTemplate); getErr == nil {
157+
if getErr := h.Client.Get(context.TODO(), client.ObjectKey{Name: spec.TargetReference.Name, Namespace: obj.Namespace}, set); getErr == nil {
158158
workloadTemplate = set
159159
}
160160
}

0 commit comments

Comments
 (0)