Skip to content

Commit b96bc5c

Browse files
Merge pull request #2838 from Nordix/fix-v1beta2-conditions/adil
🌱 Remove message from v1beta2 true conditions
2 parents 9a8eea5 + e5634b0 commit b96bc5c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

controllers/metal3machine_controller.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,9 @@ func (r *Metal3MachineReconciler) Reconcile(ctx context.Context, req ctrl.Reques
218218
machineLog.Info("reconciliation is paused for this object")
219219
v1beta1conditions.MarkFalse(capm3Machine, infrav1.AssociateBMHCondition, infrav1.Metal3MachinePausedReason, clusterv1beta1.ConditionSeverityInfo, "")
220220
deprecatedv1beta2conditions.Set(capm3Machine, metav1.Condition{
221-
Type: clusterv1beta1.PausedV1Beta2Condition,
222-
Status: metav1.ConditionTrue,
223-
Reason: clusterv1beta1.PausedV1Beta2Reason,
224-
Message: "Pause annotation set on associated BareMetalHost",
221+
Type: clusterv1beta1.PausedV1Beta2Condition,
222+
Status: metav1.ConditionTrue,
223+
Reason: clusterv1beta1.PausedV1Beta2Reason,
225224
})
226225
return ctrl.Result{Requeue: true, RequeueAfter: requeueAfter}, nil
227226
}
@@ -325,7 +324,7 @@ func (r *Metal3MachineReconciler) reconcileNormal(ctx context.Context,
325324
}
326325
// Update Condition to reflect that we have an associated BMH
327326
machineMgr.SetConditionMetal3MachineToTrue(infrav1.AssociateBMHCondition)
328-
machineMgr.SetV1beta2Condition(infrav1.AssociateBareMetalHostV1Beta2Condition, metav1.ConditionTrue, infrav1.AssociateBareMetalHostSuccessV1Beta2Reason, "Metal3Machine is associated with a BareMetalHost")
327+
machineMgr.SetV1beta2Condition(infrav1.AssociateBareMetalHostV1Beta2Condition, metav1.ConditionTrue, infrav1.AssociateBareMetalHostSuccessV1Beta2Reason, "")
329328

330329
// Make sure that the metadata is ready if any
331330
err := machineMgr.AssociateM3Metadata(ctx)
@@ -335,7 +334,7 @@ func (r *Metal3MachineReconciler) reconcileNormal(ctx context.Context,
335334
return checkMachineError(machineMgr, err,
336335
"Failed to get the Metal3Metadata", errType)
337336
}
338-
machineMgr.SetV1beta2Condition(infrav1.AssociateMetal3MachineMetaDataV1Beta2Condition, metav1.ConditionTrue, infrav1.AssociateMetal3MachineMetaDataSuccessV1Beta2Reason, "Metal3Machine metadata is associated successfully")
337+
machineMgr.SetV1beta2Condition(infrav1.AssociateMetal3MachineMetaDataV1Beta2Condition, metav1.ConditionTrue, infrav1.AssociateMetal3MachineMetaDataSuccessV1Beta2Reason, "")
339338

340339
err = machineMgr.Update(ctx)
341340
if err != nil {

controllers/metal3machine_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ func setReconcileNormalExpectations(ctrl *gomock.Controller,
107107
m.EXPECT().SetConditionMetal3MachineToTrue(infrav1.AssociateBMHCondition)
108108
m.EXPECT().SetV1beta2Condition(infrav1.AssociateBareMetalHostV1Beta2Condition,
109109
metav1.ConditionTrue, infrav1.AssociateBareMetalHostSuccessV1Beta2Reason,
110-
"Metal3Machine is associated with a BareMetalHost")
110+
"")
111111
if tc.Metal3DataClaimCreated {
112112
m.EXPECT().AssociateM3Metadata(context.TODO())
113113
m.EXPECT().SetV1beta2Condition(infrav1.AssociateMetal3MachineMetaDataV1Beta2Condition,
114114
metav1.ConditionTrue, infrav1.AssociateMetal3MachineMetaDataSuccessV1Beta2Reason,
115-
"Metal3Machine metadata is associated successfully")
115+
"")
116116
} else {
117117
m.EXPECT().AssociateM3Metadata(context.TODO()).Return(errors.New("Failed"))
118118
m.EXPECT().SetConditionMetal3MachineToFalse(infrav1.KubernetesNodeReadyCondition,

0 commit comments

Comments
 (0)