Skip to content

Commit

Permalink
Merge pull request #1573 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1555-to-release-4.14

[release-4.14] OCPBUGS-20508: regeneratemco: explicitly check for PlatformStatus field
  • Loading branch information
openshift-ci[bot] committed Nov 1, 2023
2 parents 0c63f9d + 4955b09 commit 035884c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/cli/admin/ocpcertificates/regeneratemco/rotatecerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,26 +131,41 @@ func getServerIPsFromInfra(cfg *configv1.Infrastructure) []string {
}
switch cfg.Status.PlatformStatus.Type {
case configv1.BareMetalPlatformType:
if cfg.Status.PlatformStatus.BareMetal == nil {
return []string{}
}
if cfg.Status.PlatformStatus.BareMetal.APIServerInternalIPs != nil {
return cfg.Status.PlatformStatus.BareMetal.APIServerInternalIPs
}
return []string{cfg.Status.PlatformStatus.BareMetal.APIServerInternalIP}
case configv1.OvirtPlatformType:
if cfg.Status.PlatformStatus.Ovirt == nil {
return []string{}
}
if cfg.Status.PlatformStatus.Ovirt.APIServerInternalIPs != nil {
return cfg.Status.PlatformStatus.Ovirt.APIServerInternalIPs
}
return []string{cfg.Status.PlatformStatus.Ovirt.APIServerInternalIP}
case configv1.OpenStackPlatformType:
if cfg.Status.PlatformStatus.OpenStack == nil {
return []string{}
}
if cfg.Status.PlatformStatus.OpenStack.APIServerInternalIPs != nil {
return cfg.Status.PlatformStatus.OpenStack.APIServerInternalIPs
}
return []string{cfg.Status.PlatformStatus.OpenStack.APIServerInternalIP}
case configv1.VSpherePlatformType:
if cfg.Status.PlatformStatus.VSphere == nil {
return []string{}
}
if cfg.Status.PlatformStatus.VSphere.APIServerInternalIPs != nil {
return cfg.Status.PlatformStatus.VSphere.APIServerInternalIPs
}
return []string{cfg.Status.PlatformStatus.VSphere.APIServerInternalIP}
case configv1.NutanixPlatformType:
if cfg.Status.PlatformStatus.Nutanix == nil {
return []string{}
}
if cfg.Status.PlatformStatus.Nutanix.APIServerInternalIPs != nil {
return cfg.Status.PlatformStatus.Nutanix.APIServerInternalIPs
}
Expand Down

0 comments on commit 035884c

Please sign in to comment.