Skip to content

Commit

Permalink
Merge pull request #94 from aman4433/release-4.17
Browse files Browse the repository at this point in the history
OCPBUGS-44880: Fetch service instance id from spec of IBMPowerVSCluster object while setting provider id
  • Loading branch information
openshift-merge-bot[bot] authored Nov 28, 2024
2 parents a2beaa3 + 379f9ef commit 213d34d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cloud/scope/powervs_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,10 +922,16 @@ func (m *PowerVSMachineScope) GetZone() string {

// GetServiceInstanceID returns the service instance id.
func (m *PowerVSMachineScope) GetServiceInstanceID() string {
if m.IBMPowerVSCluster.Status.ServiceInstance == nil || m.IBMPowerVSCluster.Status.ServiceInstance.ID == nil {
return ""
if m.IBMPowerVSCluster.Status.ServiceInstance != nil && m.IBMPowerVSCluster.Status.ServiceInstance.ID != nil {
return *m.IBMPowerVSCluster.Status.ServiceInstance.ID
}
if m.IBMPowerVSCluster.Spec.ServiceInstanceID != "" {
return m.IBMPowerVSCluster.Spec.ServiceInstanceID
}
return *m.IBMPowerVSCluster.Status.ServiceInstance.ID
if m.IBMPowerVSCluster.Spec.ServiceInstance != nil && m.IBMPowerVSCluster.Spec.ServiceInstance.ID != nil {
return *m.IBMPowerVSCluster.Spec.ServiceInstance.ID
}
return ""
}

// SetProviderID will set the provider id for the machine.
Expand Down

0 comments on commit 213d34d

Please sign in to comment.