@@ -43,12 +43,14 @@ func (s *Service) Reconcile(ctx context.Context) (ctrl.Result, error) {
43
43
44
44
cluster , err := s .describeCluster (ctx , & log )
45
45
if err != nil {
46
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
46
47
s .scope .GCPManagedControlPlane .Status .Ready = false
47
48
conditions .MarkFalse (s .scope .ConditionSetter (), clusterv1 .ReadyCondition , infrav1exp .GKEControlPlaneReconciliationFailedReason , clusterv1 .ConditionSeverityError , err .Error ())
48
49
return ctrl.Result {}, err
49
50
}
50
51
if cluster == nil {
51
52
log .Info ("Cluster not found, creating" )
53
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
52
54
s .scope .GCPManagedControlPlane .Status .Ready = false
53
55
54
56
nodePools , _ , err := s .scope .GetAllNodePools (ctx )
@@ -99,18 +101,21 @@ func (s *Service) Reconcile(ctx context.Context) (ctrl.Result, error) {
99
101
conditions .MarkFalse (s .scope .ConditionSetter (), clusterv1 .ReadyCondition , infrav1exp .GKEControlPlaneCreatingReason , clusterv1 .ConditionSeverityInfo , "" )
100
102
conditions .MarkFalse (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneReadyCondition , infrav1exp .GKEControlPlaneCreatingReason , clusterv1 .ConditionSeverityInfo , "" )
101
103
conditions .MarkTrue (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneCreatingCondition )
104
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
102
105
s .scope .GCPManagedControlPlane .Status .Ready = false
103
106
return ctrl.Result {RequeueAfter : reconciler .DefaultRetryTime }, nil
104
107
case containerpb .Cluster_RECONCILING :
105
108
log .Info ("Cluster reconciling in progress" )
106
109
conditions .MarkTrue (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneUpdatingCondition )
110
+ s .scope .GCPManagedControlPlane .Status .Initialized = true
107
111
s .scope .GCPManagedControlPlane .Status .Ready = true
108
112
return ctrl.Result {RequeueAfter : reconciler .DefaultRetryTime }, nil
109
113
case containerpb .Cluster_STOPPING :
110
114
log .Info ("Cluster stopping in progress" )
111
115
conditions .MarkFalse (s .scope .ConditionSetter (), clusterv1 .ReadyCondition , infrav1exp .GKEControlPlaneDeletingReason , clusterv1 .ConditionSeverityInfo , "" )
112
116
conditions .MarkFalse (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneReadyCondition , infrav1exp .GKEControlPlaneDeletingReason , clusterv1 .ConditionSeverityInfo , "" )
113
117
conditions .MarkTrue (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneDeletingCondition )
118
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
114
119
s .scope .GCPManagedControlPlane .Status .Ready = false
115
120
return ctrl.Result {RequeueAfter : reconciler .DefaultRetryTime }, nil
116
121
case containerpb .Cluster_ERROR , containerpb .Cluster_DEGRADED :
@@ -121,6 +126,7 @@ func (s *Service) Reconcile(ctx context.Context) (ctrl.Result, error) {
121
126
log .Error (errors .New ("Cluster in error/degraded state" ), msg , "name" , s .scope .ClusterName ())
122
127
conditions .MarkFalse (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneReadyCondition , infrav1exp .GKEControlPlaneErrorReason , clusterv1 .ConditionSeverityError , "" )
123
128
s .scope .GCPManagedControlPlane .Status .Ready = false
129
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
124
130
return ctrl.Result {}, nil
125
131
case containerpb .Cluster_RUNNING :
126
132
log .Info ("Cluster running" )
@@ -139,6 +145,7 @@ func (s *Service) Reconcile(ctx context.Context) (ctrl.Result, error) {
139
145
}
140
146
log .Info ("Cluster updating in progress" )
141
147
conditions .MarkTrue (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneUpdatingCondition )
148
+ s .scope .GCPManagedControlPlane .Status .Initialized = true
142
149
s .scope .GCPManagedControlPlane .Status .Ready = true
143
150
return ctrl.Result {}, nil
144
151
}
@@ -161,6 +168,7 @@ func (s *Service) Reconcile(ctx context.Context) (ctrl.Result, error) {
161
168
conditions .MarkTrue (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneReadyCondition )
162
169
conditions .MarkFalse (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneCreatingCondition , infrav1exp .GKEControlPlaneCreatedReason , clusterv1 .ConditionSeverityInfo , "" )
163
170
s .scope .GCPManagedControlPlane .Status .Ready = true
171
+ s .scope .GCPManagedControlPlane .Status .Initialized = true
164
172
165
173
log .Info ("Cluster reconciled" )
166
174
@@ -203,6 +211,7 @@ func (s *Service) Delete(ctx context.Context) (ctrl.Result, error) {
203
211
return ctrl.Result {}, err
204
212
}
205
213
log .Info ("Cluster deleting in progress" )
214
+ s .scope .GCPManagedControlPlane .Status .Initialized = false
206
215
s .scope .GCPManagedControlPlane .Status .Ready = false
207
216
conditions .MarkFalse (s .scope .ConditionSetter (), clusterv1 .ReadyCondition , infrav1exp .GKEControlPlaneDeletingReason , clusterv1 .ConditionSeverityInfo , "" )
208
217
conditions .MarkFalse (s .scope .ConditionSetter (), infrav1exp .GKEControlPlaneReadyCondition , infrav1exp .GKEControlPlaneDeletingReason , clusterv1 .ConditionSeverityInfo , "" )
0 commit comments