Skip to content

Commit 598bec7

Browse files
committed
fix: Align validation with upstream Kubeadm Bootstrap Provider types
The maxLength was too short in some cases, breaking cluster creation. Now, all parameters align with the upstream types.
1 parent 1961ebf commit 598bec7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

api/v1alpha1/clusterconfig_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ type ImageRegistry struct {
362362
type User struct {
363363
// Name specifies the user name.
364364
// +kubebuilder:validation:Required
365+
// +kubebuilder:validation:MinLength=1
365366
// +kubebuilder:validation:MaxLength=256
366367
Name string `json:"name"`
367368

@@ -371,23 +372,24 @@ type User struct {
371372
// An empty string is not marshalled, because it is not a valid value.
372373
// +kubebuilder:validation:Optional
373374
// +kubebuilder:validation:MinLength=1
374-
// +kubebuilder:validation:MaxLength=106
375+
// +kubebuilder:validation:MaxLength=256
375376
HashedPassword string `json:"hashedPassword,omitempty"`
376377

377378
// SSHAuthorizedKeys is a list of public SSH keys to write to the
378379
// machine. Use the corresponding private SSH keys to authenticate. See SSH
379380
// documentation for instructions to create a key pair.
380381
// +kubebuilder:validation:Optional
381-
// +kubebuilder:validation:MaxItems=32
382-
// +kubebuilder:validation:items:MaxLength=256
382+
// +kubebuilder:validation:MaxItems=100
383+
// +kubebuilder:validation:items:MinLength=1
384+
// +kubebuilder:validation:items:MaxLength=2048
383385
SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"`
384386

385387
// Sudo is a sudo user specification, formatted as described in the sudo
386388
// documentation.
387389
// An empty string is not marshalled, because it is not a valid value.
388390
// +kubebuilder:validation:Optional
389391
// +kubebuilder:validation:MinLength=1
390-
// +kubebuilder:validation:MaxLength=1024
392+
// +kubebuilder:validation:MaxLength=256
391393
Sudo string `json:"sudo,omitempty"`
392394
}
393395

0 commit comments

Comments
 (0)