@@ -100,14 +100,26 @@ func (c *NodeCADaemonController) sync() error {
100
100
Status : operatorv1 .ConditionUnknown ,
101
101
}
102
102
103
+ progressingCondition := operatorv1.OperatorCondition {
104
+ Type : "NodeCADaemonProgressing" ,
105
+ Status : operatorv1 .ConditionUnknown ,
106
+ }
107
+
103
108
dsObj , err := gen .Get ()
104
109
if errors .IsNotFound (err ) {
105
110
availableCondition .Status = operatorv1 .ConditionFalse
106
111
availableCondition .Reason = "NotFound"
107
112
availableCondition .Message = "The daemon set node-ca does not exist"
113
+
114
+ progressingCondition .Status = operatorv1 .ConditionTrue
115
+ progressingCondition .Reason = "NotFound"
116
+ progressingCondition .Message = "The daemon set node-ca does not exist"
108
117
} else if err != nil {
109
118
availableCondition .Reason = "Unknown"
110
119
availableCondition .Message = fmt .Sprintf ("Unable to check daemon set availability: %s" , err )
120
+
121
+ progressingCondition .Reason = "Unknown"
122
+ progressingCondition .Message = fmt .Sprintf ("Unable to check daemon set progress: %s" , err )
111
123
} else {
112
124
ds := dsObj .(* appsv1.DaemonSet )
113
125
if ds .Status .NumberAvailable > 0 {
@@ -119,6 +131,20 @@ func (c *NodeCADaemonController) sync() error {
119
131
availableCondition .Reason = "NoAvailableReplicas"
120
132
availableCondition .Message = "The daemon set node-ca does not have available replicas"
121
133
}
134
+
135
+ if ds .Generation != ds .Status .ObservedGeneration {
136
+ progressingCondition .Status = operatorv1 .ConditionTrue
137
+ progressingCondition .Reason = "Progressing"
138
+ progressingCondition .Message = "The daemon set node-ca is updating node pods"
139
+ } else if ds .Status .NumberUnavailable > 0 {
140
+ progressingCondition .Status = operatorv1 .ConditionTrue
141
+ progressingCondition .Reason = "Unavailable"
142
+ progressingCondition .Message = "The daemon set node-ca is deploying node pods"
143
+ } else {
144
+ progressingCondition .Status = operatorv1 .ConditionFalse
145
+ progressingCondition .Reason = "AsExpected"
146
+ progressingCondition .Message = "The daemon set node-ca is deployed"
147
+ }
122
148
}
123
149
124
150
err = resource .ApplyMutator (gen )
@@ -127,6 +153,7 @@ func (c *NodeCADaemonController) sync() error {
127
153
ctx ,
128
154
c .operatorClient ,
129
155
v1helpers .UpdateConditionFn (availableCondition ),
156
+ v1helpers .UpdateConditionFn (progressingCondition ),
130
157
v1helpers .UpdateConditionFn (operatorv1.OperatorCondition {
131
158
Type : "NodeCADaemonControllerDegraded" ,
132
159
Status : operatorv1 .ConditionTrue ,
@@ -141,6 +168,7 @@ func (c *NodeCADaemonController) sync() error {
141
168
ctx ,
142
169
c .operatorClient ,
143
170
v1helpers .UpdateConditionFn (availableCondition ),
171
+ v1helpers .UpdateConditionFn (progressingCondition ),
144
172
v1helpers .UpdateConditionFn (operatorv1.OperatorCondition {
145
173
Type : "NodeCADaemonControllerDegraded" ,
146
174
Status : operatorv1 .ConditionFalse ,
0 commit comments