Skip to content

Commit e3bc230

Browse files
committed
improve instance tagging logic
1 parent 0c43650 commit e3bc230

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pkg/cloudprovider/providers/oci/instances.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (cp *CloudProvider) extractNodeAddresses(ctx context.Context, instanceID st
9797
}
9898
addresses = append(addresses, api.NodeAddress{Type: api.NodeExternalIP, Address: ip.String()})
9999
}
100-
if cp.checkOpenShiftISCSIBootVolumeByInstance(ctx, instanceID) {
100+
if cp.checkOpenShiftInstance(ctx, instanceID) {
101101
secondaryVnic, err := cp.client.Compute().GetSecondaryVNICForInstance(ctx, compartmentID, instanceID)
102102
if err != nil {
103103
return nil, errors.Wrap(err, "GetSecondaryVNICForInstance")
@@ -352,16 +352,14 @@ func (cp *CloudProvider) checkOpenShiftISCSIBootVolumeByVnic(ctx context.Context
352352
return false
353353
}
354354

355-
func (cp *CloudProvider) checkOpenShiftISCSIBootVolumeByInstance(ctx context.Context, instanceID string) bool {
355+
func (cp *CloudProvider) checkOpenShiftInstance(ctx context.Context, instanceID string) bool {
356356
instance, err := cp.client.Compute().GetInstance(ctx, instanceID)
357357
if err != nil {
358358
return false
359359
}
360360
for namespace := range instance.DefinedTags {
361361
if strings.HasPrefix(namespace, "openshift") {
362-
if bootVolume, exist := instance.DefinedTags[namespace]["boot-volume-type"]; exist && bootVolume == "ISCSI" {
363-
return true
364-
}
362+
return true
365363
}
366364
}
367365
return false

0 commit comments

Comments
 (0)