Skip to content

Commit c8e3e1a

Browse files
committed
Enable node update controller to update storage pool affinity when PVM instance is in WARNING state
1 parent a2ba7ab commit c8e3e1a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

adhoc-controllers/controllers/nodeupdate_controller.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,14 @@ func (r *NodeUpdateReconciler) Reconcile(_ context.Context, req ctrl.Request) (c
8787
if *instance.StoragePoolAffinity {
8888
switch *instance.Status {
8989
case cloud.PowerVSInstanceStateSHUTOFF, cloud.PowerVSInstanceStateACTIVE:
90-
switch instance.Health.Status {
91-
case cloud.PowerVSInstanceHealthOK:
90+
if *instance.StoragePoolAffinity == cloud.StoragePoolAffinity {
91+
klog.Infof("PowerVS instance - %v Storage pool affinity already %t", instance.PvmInstanceID, cloud.StoragePoolAffinity)
92+
} else {
9293
err := r.getOrUpdate(nodeUpdateScope)
9394
if err != nil {
9495
klog.Infof("unable to update instance StoragePoolAffinity %v", err)
9596
return ctrl.Result{}, errors.Wrapf(err, "failed to reconcile VSI for IBMPowerVSMachine %s/%s", node.Namespace, node.Name)
9697
}
97-
default:
98-
klog.Infof("PowerVS instance - %v health not OK yet", instance.PvmInstanceID)
9998
}
10099
default:
101100
klog.Infof("PowerVS instance - %v state not ACTIVE/SHUTOFF yet", instance.PvmInstanceID)

pkg/cloud/powervs_node.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
const (
2626
PowerVSInstanceStateSHUTOFF = "SHUTOFF"
2727
PowerVSInstanceStateACTIVE = "ACTIVE"
28-
PowerVSInstanceHealthOK = "OK"
2928
StoragePoolAffinity = false
3029
ProviderIDValidLength = 6
3130
)

0 commit comments

Comments
 (0)