Skip to content

Commit 7a02662

Browse files
committed
fix review finding
1 parent 2f4474a commit 7a02662

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bootstrap/kubeadm/api/v1beta1/kubeadmconfig_webhook.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,17 @@ func (c *KubeadmConfigSpec) validateFiles(pathPrefix *field.Path) field.ErrorLis
106106
if file.ContentFrom.Secret.Name == "" {
107107
allErrs = append(
108108
allErrs,
109-
field.Invalid(
109+
field.Required(
110110
pathPrefix.Child("files").Index(i).Child("contentFrom", "secret", "name"),
111-
file,
112111
missingSecretNameMsg,
113112
),
114113
)
115114
}
116115
if file.ContentFrom.Secret.Key == "" {
117116
allErrs = append(
118117
allErrs,
119-
field.Invalid(
118+
field.Required(
120119
pathPrefix.Child("files").Index(i).Child("contentFrom", "secret", "key"),
121-
file,
122120
missingSecretKeyMsg,
123121
),
124122
)

0 commit comments

Comments
 (0)