Skip to content

Commit c70fd65

Browse files
authored
Merge pull request #4992 from isabella-janssen/use-v1-mcn-crds
MCO-1519: Adapt MCO code to use V1 MCN API
2 parents 04de158 + 25795b5 commit c70fd65

File tree

51 files changed

+2653
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2653
-214
lines changed

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ require (
294294
github.com/securego/gosec/v2 v2.21.4 // indirect
295295
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
296296
github.com/sigstore/sigstore v1.8.12 // indirect
297-
github.com/sirupsen/logrus v1.9.3
297+
github.com/sirupsen/logrus v1.9.3 // indirect
298298
github.com/sivchari/containedctx v1.0.3 // indirect
299299
github.com/sivchari/tenv v1.12.1 // indirect
300300
github.com/sonatard/noctx v0.1.0 // indirect
@@ -350,3 +350,8 @@ require (
350350
)
351351

352352
replace k8s.io/kube-openapi => github.com/openshift/kube-openapi v0.0.0-20230816122517-ffc8f001abb0
353+
354+
// The following replace commands are in place to allow the simultaneous merge of the API & MCO for making use of the V1 MCN API
355+
replace github.com/openshift/api => github.com/isabella-janssen/openshift-api v0.0.0-20250423163652-3d76f1835b2c
356+
357+
replace github.com/openshift/client-go => github.com/isabella-janssen/openshift-client-go v0.0.0-20250423165717-b84d4e80502c

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
370370
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
371371
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
372372
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
373+
github.com/isabella-janssen/openshift-api v0.0.0-20250423163652-3d76f1835b2c h1:ZXr+C67yjbTVngH2A0aJF+/TkRA0bMxz9xuOWoQE8p8=
374+
github.com/isabella-janssen/openshift-api v0.0.0-20250423163652-3d76f1835b2c/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
375+
github.com/isabella-janssen/openshift-client-go v0.0.0-20250423165717-b84d4e80502c h1:2zTo28G79Fs9TfhlRJimpsZRj4TZag/i03fzzTdnR8E=
376+
github.com/isabella-janssen/openshift-client-go v0.0.0-20250423165717-b84d4e80502c/go.mod h1:Ee2bsd/VaaRLMVFFn2qWZ3Cl9jwAeUjzCiPvMTnGkGI=
373377
github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk=
374378
github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4=
375379
github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs=
@@ -513,10 +517,6 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ
513517
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
514518
github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=
515519
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
516-
github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e h1:+nJrGJMAhBH8yhXe7u3z44IWA/kHtzgjmpOAry+aeb4=
517-
github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw=
518-
github.com/openshift/client-go v0.0.0-20250402181141-b3bad3b645f2 h1:bPXR0R8zp1o12nSUphN26hSM+OKYq5pMorbDCpApzDQ=
519-
github.com/openshift/client-go v0.0.0-20250402181141-b3bad3b645f2/go.mod h1:dT1cJyVTperQ53GvVRa+GZ27r02fDZy2k5j+9QoQsCo=
520520
github.com/openshift/kube-openapi v0.0.0-20230816122517-ffc8f001abb0 h1:GPlAy197Jkr+D0T2FNWanamraTdzS/r9ZkT29lxvHaA=
521521
github.com/openshift/kube-openapi v0.0.0-20230816122517-ffc8f001abb0/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
522522
github.com/openshift/library-go v0.0.0-20250129210218-fe56c2cf5d70 h1:VLj8CU9q009xlMuR4wNcqDX4lVa2Ji3u/iYnBLHtQUc=

lib/resourceapply/machineconfig.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import (
44
"context"
55

66
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
7-
mcfgalphav1 "github.com/openshift/api/machineconfiguration/v1alpha1"
8-
97
mcfgclientv1 "github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1"
10-
mcfgclientalphav1 "github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1alpha1"
118

129
mcoResourceMerge "github.com/openshift/machine-config-operator/lib/resourcemerge"
1310
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -59,7 +56,7 @@ func ApplyMachineConfigPool(client mcfgclientv1.MachineConfigPoolsGetter, requir
5956
}
6057

6158
// ApplyMachineConfigNode applies the required machineconfignode to the cluster.
62-
func ApplyMachineConfigNode(client mcfgclientalphav1.MachineConfigNodesGetter, required *mcfgalphav1.MachineConfigNode) (*mcfgalphav1.MachineConfigNode, bool, error) {
59+
func ApplyMachineConfigNode(client mcfgclientv1.MachineConfigNodesGetter, required *mcfgv1.MachineConfigNode) (*mcfgv1.MachineConfigNode, bool, error) {
6360
existing, err := client.MachineConfigNodes().Get(context.TODO(), required.GetName(), metav1.GetOptions{})
6461
if apierrors.IsNotFound(err) {
6562
actual, err := client.MachineConfigNodes().Create(context.TODO(), required, metav1.CreateOptions{})

lib/resourcemerge/machineconfig.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package resourcemerge
22

33
import (
44
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
5-
mcfgalphav1 "github.com/openshift/api/machineconfiguration/v1alpha1"
65

76
"github.com/openshift/library-go/pkg/operator/resource/resourcemerge"
87
"k8s.io/apimachinery/pkg/api/equality"
98
)
109

1110
// EnsureMachineConfig ensures that the existing matches the required.
1211
// modified is set to true when existing had to be updated with required.
13-
func EnsureMachineConfigNode(modified *bool, existing *mcfgalphav1.MachineConfigNode, required mcfgalphav1.MachineConfigNode) {
12+
func EnsureMachineConfigNode(modified *bool, existing *mcfgv1.MachineConfigNode, required mcfgv1.MachineConfigNode) {
1413
resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta)
1514
ensureMachineConfigNodeSpec(modified, &existing.Spec, required.Spec)
1615
}
@@ -53,7 +52,7 @@ func EnsureMachineConfigPool(modified *bool, existing *mcfgv1.MachineConfigPool,
5352
}
5453
}
5554

56-
func ensureMachineConfigNodeSpec(modified *bool, existing *mcfgalphav1.MachineConfigNodeSpec, required mcfgalphav1.MachineConfigNodeSpec) {
55+
func ensureMachineConfigNodeSpec(modified *bool, existing *mcfgv1.MachineConfigNodeSpec, required mcfgv1.MachineConfigNodeSpec) {
5756
if !equality.Semantic.DeepEqual(existing.Node, required.Node) {
5857
*modified = true
5958
(*existing).Node = required.Node

lib/resourceread/machineconfig.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import (
55
"fmt"
66

77
mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
8-
opv1 "github.com/openshift/api/operator/v1"
9-
108
mcfgalphav1 "github.com/openshift/api/machineconfiguration/v1alpha1"
9+
opv1 "github.com/openshift/api/operator/v1"
1110

1211
"k8s.io/apimachinery/pkg/runtime"
1312
"k8s.io/apimachinery/pkg/runtime/serializer"
@@ -18,7 +17,6 @@ var (
1817
mcfgCodecs = serializer.NewCodecFactory(mcfgScheme)
1918

2019
mcfgAlphaScheme = runtime.NewScheme()
21-
mcfgAlphaCodecs = serializer.NewCodecFactory(mcfgAlphaScheme)
2220

2321
opv1Scheme = runtime.NewScheme()
2422
opv1Codec = serializer.NewCodecFactory(opv1Scheme)
@@ -77,12 +75,12 @@ func ReadMachineConfigPoolV1OrDie(objBytes []byte) *mcfgv1.MachineConfigPool {
7775
}
7876

7977
// ReadMachineConfigPoolV1OrDie reads MachineConfigPool object from bytes. Panics on error.
80-
func ReadMachineConfigNodeV1OrDie(objBytes []byte) *mcfgalphav1.MachineConfigNode {
81-
requiredObj, err := runtime.Decode(mcfgAlphaCodecs.UniversalDecoder(mcfgalphav1.SchemeGroupVersion), objBytes)
78+
func ReadMachineConfigNodeV1OrDie(objBytes []byte) *mcfgv1.MachineConfigNode {
79+
requiredObj, err := runtime.Decode(mcfgCodecs.UniversalDecoder(mcfgv1.SchemeGroupVersion), objBytes)
8280
if err != nil {
8381
panic(err)
8482
}
85-
return requiredObj.(*mcfgalphav1.MachineConfigNode)
83+
return requiredObj.(*mcfgv1.MachineConfigNode)
8684
}
8785

8886
// ReadControllerConfigV1OrDie reads ControllerConfig object from bytes. Panics on error.

manifests/machineconfigdaemon/mcn-guards-validatingadmissionpolicy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
objectSelector: {}
1111
resourceRules:
1212
- apiGroups: ["machineconfiguration.openshift.io"]
13-
apiVersions: ["v1alpha1"]
13+
apiVersions: ["v1"]
1414
operations: ["CREATE","UPDATE"]
1515
resources: ["machineconfignodes/status","machineconfignodes"]
1616
scope: "*"

pkg/controller/drain/drain_controller.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/openshift/api/machineconfiguration/v1alpha1"
10+
v1 "github.com/openshift/api/machineconfiguration/v1"
1111
mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned"
1212
"github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme"
1313
"github.com/openshift/library-go/pkg/operator/configobserver/featuregates"
@@ -327,8 +327,8 @@ func (ctrl *Controller) syncNode(key string) error {
327327
ctrl.logNode(node, "uncordoning")
328328
// perform uncordon
329329
if err := ctrl.cordonOrUncordonNode(false, node, drainer); err != nil {
330-
nErr := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateComplete, Reason: string(v1alpha1.MachineConfigNodeUpdateUncordoned), Message: "Failed to Uncordon Node as part of completing upgrade phase"},
331-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateUncordoned, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateComplete), string(v1alpha1.MachineConfigNodeUpdateUncordoned)), Message: fmt.Sprintf("Error: Failed to UnCordon node. Error is: %s The node is reporting Unschedulable = %t", err.Error(), node.Spec.Unschedulable)},
330+
nErr := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateComplete, Reason: string(v1.MachineConfigNodeUpdateUncordoned), Message: "Failed to Uncordon Node as part of completing upgrade phase"},
331+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateUncordoned, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateComplete), string(v1.MachineConfigNodeUpdateUncordoned)), Message: fmt.Sprintf("Error: Failed to UnCordon node. Error is: %s The node is reporting Unschedulable = %t", err.Error(), node.Spec.Unschedulable)},
332332
metav1.ConditionUnknown,
333333
metav1.ConditionUnknown,
334334
node,
@@ -343,8 +343,8 @@ func (ctrl *Controller) syncNode(key string) error {
343343

344344
}
345345

346-
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateComplete, Reason: string(v1alpha1.MachineConfigNodeUpdateUncordoned), Message: "Uncordoned Node as part of completing upgrade phase"},
347-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateUncordoned, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateComplete), string(v1alpha1.MachineConfigNodeUpdateUncordoned)), Message: fmt.Sprintf("UnCordoned node. The node is reporting Unschedulable = %t", node.Spec.Unschedulable)},
346+
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateComplete, Reason: string(v1.MachineConfigNodeUpdateUncordoned), Message: "Uncordoned Node as part of completing upgrade phase"},
347+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateUncordoned, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateComplete), string(v1.MachineConfigNodeUpdateUncordoned)), Message: fmt.Sprintf("UnCordoned node. The node is reporting Unschedulable = %t", node.Spec.Unschedulable)},
348348
metav1.ConditionTrue,
349349
metav1.ConditionTrue,
350350
node,
@@ -415,8 +415,8 @@ func (ctrl *Controller) drainNode(node *corev1.Node, drainer *drain.Helper) erro
415415
ctrl.logNode(node, "cordoning")
416416
// perform cordon
417417
if err := ctrl.cordonOrUncordonNode(true, node, drainer); err != nil {
418-
Nerr := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateExecuted, Reason: string(v1alpha1.MachineConfigNodeUpdateCordoned), Message: "Failed to Cordon Node as part of In progress update phase"},
419-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateCordoned, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateExecuted), string(v1alpha1.MachineConfigNodeUpdateCordoned)), Message: fmt.Sprintf("Error: Failed to Cordon node. Error is %s, The node is reporting Unschedulable = %t", err.Error(), node.Spec.Unschedulable)},
418+
Nerr := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateExecuted, Reason: string(v1.MachineConfigNodeUpdateCordoned), Message: "Failed to Cordon Node as part of In progress update phase"},
419+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateCordoned, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateExecuted), string(v1.MachineConfigNodeUpdateCordoned)), Message: fmt.Sprintf("Error: Failed to Cordon node. Error is %s, The node is reporting Unschedulable = %t", err.Error(), node.Spec.Unschedulable)},
420420
metav1.ConditionUnknown,
421421
metav1.ConditionUnknown,
422422
node,
@@ -430,8 +430,8 @@ func (ctrl *Controller) drainNode(node *corev1.Node, drainer *drain.Helper) erro
430430
return fmt.Errorf("node %s: failed to cordon: %v", node.Name, err)
431431
}
432432
ctrl.ongoingDrains[node.Name] = time.Now()
433-
err := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateExecuted, Reason: string(v1alpha1.MachineConfigNodeUpdateCordoned), Message: "Cordoned Node as part of update executed phase"},
434-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateCordoned, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateExecuted), string(v1alpha1.MachineConfigNodeUpdateCordoned)), Message: fmt.Sprintf("Cordoned node. The node is reporting Unschedulable = %t", node.Spec.Unschedulable)},
433+
err := upgrademonitor.GenerateAndApplyMachineConfigNodes(&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateExecuted, Reason: string(v1.MachineConfigNodeUpdateCordoned), Message: "Cordoned Node as part of update executed phase"},
434+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateCordoned, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateExecuted), string(v1.MachineConfigNodeUpdateCordoned)), Message: fmt.Sprintf("Cordoned node. The node is reporting Unschedulable = %t", node.Spec.Unschedulable)},
435435
metav1.ConditionUnknown,
436436
metav1.ConditionTrue,
437437
node,
@@ -447,8 +447,8 @@ func (ctrl *Controller) drainNode(node *corev1.Node, drainer *drain.Helper) erro
447447
// Attempt drain
448448
ctrl.logNode(node, "initiating drain")
449449
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(
450-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateExecuted, Reason: string(v1alpha1.MachineConfigNodeUpdateDrained), Message: "Draining Node as part of update executed phase"},
451-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateExecuted), string(v1alpha1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Draining node. The drain will not be complete until desired drainer %s matches current drainer %s", node.Annotations[daemonconsts.DesiredDrainerAnnotationKey], node.Annotations[daemonconsts.LastAppliedDrainerAnnotationKey])},
450+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateExecuted, Reason: string(v1.MachineConfigNodeUpdateDrained), Message: "Draining Node as part of update executed phase"},
451+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateExecuted), string(v1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Draining node. The drain will not be complete until desired drainer %s matches current drainer %s", node.Annotations[daemonconsts.DesiredDrainerAnnotationKey], node.Annotations[daemonconsts.LastAppliedDrainerAnnotationKey])},
452452
metav1.ConditionUnknown,
453453
metav1.ConditionUnknown,
454454
node,
@@ -477,8 +477,8 @@ func (ctrl *Controller) drainNode(node *corev1.Node, drainer *drain.Helper) erro
477477
}
478478

479479
nErr := upgrademonitor.GenerateAndApplyMachineConfigNodes(
480-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateExecuted, Reason: string(v1alpha1.MachineConfigNodeUpdateDrained), Message: "Node Drain has not succeeded"},
481-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateExecuted), string(v1alpha1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Error: Node Drain has not succeeded. Error is: %s The drain will not be complete until desired drainer %s matches current drainer %s", err.Error(), node.Annotations[daemonconsts.DesiredDrainerAnnotationKey], node.Annotations[daemonconsts.LastAppliedDrainerAnnotationKey])},
480+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateExecuted, Reason: string(v1.MachineConfigNodeUpdateDrained), Message: "Node Drain has not succeeded"},
481+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateExecuted), string(v1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Error: Node Drain has not succeeded. Error is: %s The drain will not be complete until desired drainer %s matches current drainer %s", err.Error(), node.Annotations[daemonconsts.DesiredDrainerAnnotationKey], node.Annotations[daemonconsts.LastAppliedDrainerAnnotationKey])},
482482
metav1.ConditionUnknown,
483483
metav1.ConditionUnknown,
484484
node,
@@ -494,8 +494,8 @@ func (ctrl *Controller) drainNode(node *corev1.Node, drainer *drain.Helper) erro
494494
return err
495495
}
496496
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(
497-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateExecuted, Reason: string(v1alpha1.MachineConfigNodeUpdateDrained), Message: "Drained Node as part of update executed phase"},
498-
&upgrademonitor.Condition{State: v1alpha1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1alpha1.MachineConfigNodeUpdateExecuted), string(v1alpha1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Drained node. The drain is complete as the desired drainer matches current drainer: %s", node.Annotations[daemonconsts.DesiredDrainerAnnotationKey])},
497+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateExecuted, Reason: string(v1.MachineConfigNodeUpdateDrained), Message: "Drained Node as part of update executed phase"},
498+
&upgrademonitor.Condition{State: v1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(v1.MachineConfigNodeUpdateExecuted), string(v1.MachineConfigNodeUpdateDrained)), Message: fmt.Sprintf("Drained node. The drain is complete as the desired drainer matches current drainer: %s", node.Annotations[daemonconsts.DesiredDrainerAnnotationKey])},
499499
metav1.ConditionUnknown,
500500
metav1.ConditionTrue,
501501
node,

0 commit comments

Comments
 (0)