Skip to content

Commit

Permalink
Merge pull request #3470 from jcpowermac/cors-1409
Browse files Browse the repository at this point in the history
vsphere ipi: align with baremetal and remove DNSVIP
  • Loading branch information
openshift-merge-robot committed Apr 18, 2020
2 parents 274bb3c + 12decdb commit 3051be9
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 39 deletions.
1 change: 0 additions & 1 deletion pkg/asset/installconfig/vsphere/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func validIPIInstallConfig() *types.InstallConfig {
VCenter: "valid_vcenter",
APIVIP: "192.168.111.0",
IngressVIP: "192.168.111.1",
DNSVIP: "192.168.111.2",
},
},
}
Expand Down
1 change: 0 additions & 1 deletion pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
if installConfig.Config.VSphere.APIVIP != "" {
config.Status.PlatformStatus.VSphere = &configv1.VSpherePlatformStatus{
APIServerInternalIP: installConfig.Config.VSphere.APIVIP,
NodeDNSIP: installConfig.Config.VSphere.DNSVIP,
IngressIP: installConfig.Config.VSphere.IngressVIP,
}
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/types/vsphere/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ type Platform struct {
// IngressVIP is the virtual IP address for ingress
IngressVIP string `json:"ingressVIP,omitempty"`

// DNSVIP is the virtual IP address for DNS
DNSVIP string `json:"dnsVIP,omitempty"`

// DefaultMachinePlatform is the default configuration used when
// installing on VSphere for machine pools which do not define their own
// platform configuration.
Expand Down
8 changes: 1 addition & 7 deletions pkg/types/vsphere/validation/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func ValidatePlatform(p *vsphere.Platform, fldPath *field.Path) field.ErrorList
}

// If all VIPs are empty, skip IP validation. All VIPs are required to be defined together.
if strings.Join([]string{p.APIVIP, p.IngressVIP, p.DNSVIP}, "") != "" {
if strings.Join([]string{p.APIVIP, p.IngressVIP}, "") != "" {
allErrs = append(allErrs, validateVIPs(p, fldPath)...)
}

Expand Down Expand Up @@ -69,11 +69,5 @@ func validateVIPs(p *vsphere.Platform, fldPath *field.Path) field.ErrorList {
allErrs = append(allErrs, field.Invalid(fldPath.Child("ingressVIP"), p.IngressVIP, err.Error()))
}

if len(p.DNSVIP) == 0 {
allErrs = append(allErrs, field.Required(fldPath.Child("dnsVIP"), "must specify a VIP for DNS"))
} else if err := validate.IP(p.DNSVIP); err != nil {
allErrs = append(allErrs, field.Invalid(fldPath.Child("dnsVIP"), p.DNSVIP, err.Error()))
}

return allErrs
}
27 changes: 0 additions & 27 deletions pkg/types/vsphere/validation/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func TestValidatePlatform(t *testing.T) {
p := validPlatform()
p.APIVIP = "192.168.111.2"
p.IngressVIP = "192.168.111.3"
p.DNSVIP = "192.168.111.4"
return p
}(),
// expectedError: `^test-path\.apiVIP: Invalid value: "": "" is not a valid IP`,
Expand All @@ -91,7 +90,6 @@ func TestValidatePlatform(t *testing.T) {
p := validPlatform()
p.APIVIP = ""
p.IngressVIP = "192.168.111.3"
p.DNSVIP = "192.168.111.4"
return p
}(),
expectedError: `^test-path\.apiVIP: Required value: must specify a VIP for the API`,
Expand All @@ -102,29 +100,16 @@ func TestValidatePlatform(t *testing.T) {
p := validPlatform()
p.APIVIP = "192.168.111.2"
p.IngressVIP = ""
p.DNSVIP = "192.168.111.4"
return p
}(),
expectedError: `^test-path\.ingressVIP: Required value: must specify a VIP for Ingress`,
},
{
name: "missing DNS VIP",
platform: func() *vsphere.Platform {
p := validPlatform()
p.APIVIP = "192.168.111.2"
p.IngressVIP = "192.168.111.3"
p.DNSVIP = ""
return p
}(),
expectedError: `^test-path\.dnsVIP: Required value: must specify a VIP for DNS`,
},
{
name: "Invalid API VIP",
platform: func() *vsphere.Platform {
p := validPlatform()
p.APIVIP = "192.168.111"
p.IngressVIP = "192.168.111.2"
p.DNSVIP = "192.168.111.3"
return p
}(),
expectedError: `^test-path.apiVIP: Invalid value: "192.168.111": "192.168.111" is not a valid IP`,
Expand All @@ -135,22 +120,10 @@ func TestValidatePlatform(t *testing.T) {
p := validPlatform()
p.APIVIP = "192.168.111.1"
p.IngressVIP = "192.168.111"
p.DNSVIP = "192.168.111.3"
return p
}(),
expectedError: `^test-path.ingressVIP: Invalid value: "192.168.111": "192.168.111" is not a valid IP`,
},
{
name: "Invalid DNS VIP",
platform: func() *vsphere.Platform {
p := validPlatform()
p.APIVIP = "192.168.111.2"
p.IngressVIP = "192.168.111.3"
p.DNSVIP = "192.168.111"
return p
}(),
expectedError: `^test-path.dnsVIP: Invalid value: "192.168.111": "192.168.111" is not a valid IP`,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 3051be9

Please sign in to comment.