Skip to content

Commit 6d13655

Browse files
Merge pull request #10663 from ankimaha-sys/fix-vsphere-username-error-message
no-jira: fix vCenter validation error to use correct field name
2 parents e12fd79 + 25a0d6f commit 6d13655

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/types/vsphere/validation/platform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func validateVCenters(p *vsphere.Platform, fldPath *field.Path) field.ErrorList
143143
}
144144
}
145145
if len(vCenter.Username) == 0 {
146-
allErrs = append(allErrs, field.Required(fldPath.Index(index).Child("username"), "must specify the username"))
146+
allErrs = append(allErrs, field.Required(fldPath.Index(index).Child("user"), "must specify the user"))
147147
}
148148
if len(vCenter.Password) == 0 {
149149
allErrs = append(allErrs, field.Required(fldPath.Index(index).Child("password"), "must specify the password"))

pkg/types/vsphere/validation/platform_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ func TestValidatePlatform(t *testing.T) {
455455
p.VCenters[0].Username = ""
456456
return p
457457
}(),
458-
expectedError: `^test-path\.vcenters\[0].username: Required value: must specify the username$`,
458+
expectedError: `^test-path\.vcenters\[0].user: Required value: must specify the user$`,
459459
},
460460
{
461461
name: "Multi-zone missing password",

0 commit comments

Comments
 (0)