@@ -61,23 +61,23 @@ func (r *ClusterBackEndReconciler) ReconcileNormal(ctx context.Context, cluster
61
61
dockerCluster .Spec .Backend .Docker .LoadBalancer .ImageTag ,
62
62
strconv .Itoa (dockerCluster .Spec .ControlPlaneEndpoint .Port ))
63
63
if err != nil {
64
- v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , infrav1 .LoadBalancerProvisioningFailedReason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
64
+ v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition , infrav1 .LoadBalancerProvisioningFailedV1Beta1Reason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
65
65
conditions .Set (dockerCluster , metav1.Condition {
66
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
66
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
67
67
Status : metav1 .ConditionFalse ,
68
- Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableV1Beta2Reason ,
68
+ Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableReason ,
69
69
Message : fmt .Sprintf ("Failed to create helper for managing the externalLoadBalancer: %v" , err ),
70
70
})
71
71
return ctrl.Result {}, errors .Wrapf (err , "failed to create helper for managing the externalLoadBalancer" )
72
72
}
73
73
74
74
// Create the docker container hosting the load balancer.
75
75
if err := externalLoadBalancer .Create (ctx ); err != nil {
76
- v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , infrav1 .LoadBalancerProvisioningFailedReason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
76
+ v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition , infrav1 .LoadBalancerProvisioningFailedV1Beta1Reason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
77
77
conditions .Set (dockerCluster , metav1.Condition {
78
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
78
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
79
79
Status : metav1 .ConditionFalse ,
80
- Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableV1Beta2Reason ,
80
+ Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableReason ,
81
81
Message : fmt .Sprintf ("Failed to create load balancer: %v" , err ),
82
82
})
83
83
return ctrl.Result {}, errors .Wrap (err , "failed to create load balancer" )
@@ -86,11 +86,11 @@ func (r *ClusterBackEndReconciler) ReconcileNormal(ctx context.Context, cluster
86
86
// Set APIEndpoints with the load balancer IP so the Cluster API Cluster Controller can pull it
87
87
lbIP , err := externalLoadBalancer .IP (ctx )
88
88
if err != nil {
89
- v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , infrav1 .LoadBalancerProvisioningFailedReason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
89
+ v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition , infrav1 .LoadBalancerProvisioningFailedV1Beta1Reason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
90
90
conditions .Set (dockerCluster , metav1.Condition {
91
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
91
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
92
92
Status : metav1 .ConditionFalse ,
93
- Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableV1Beta2Reason ,
93
+ Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableReason ,
94
94
Message : fmt .Sprintf ("Failed to get ip for the load balancer: %v" , err ),
95
95
})
96
96
return ctrl.Result {}, errors .Wrap (err , "failed to get ip for the load balancer" )
@@ -104,11 +104,11 @@ func (r *ClusterBackEndReconciler) ReconcileNormal(ctx context.Context, cluster
104
104
105
105
// Mark the dockerCluster ready
106
106
dockerCluster .Status .Ready = true
107
- v1beta1conditions .MarkTrue (dockerCluster , infrav1 .LoadBalancerAvailableCondition )
107
+ v1beta1conditions .MarkTrue (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition )
108
108
conditions .Set (dockerCluster , metav1.Condition {
109
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
109
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
110
110
Status : metav1 .ConditionTrue ,
111
- Reason : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Reason ,
111
+ Reason : infrav1 .DevClusterDockerLoadBalancerAvailableReason ,
112
112
})
113
113
114
114
return ctrl.Result {}, nil
@@ -126,11 +126,11 @@ func (r *ClusterBackEndReconciler) ReconcileDelete(ctx context.Context, cluster
126
126
dockerCluster .Spec .Backend .Docker .LoadBalancer .ImageTag ,
127
127
strconv .Itoa (dockerCluster .Spec .ControlPlaneEndpoint .Port ))
128
128
if err != nil {
129
- v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , infrav1 .LoadBalancerProvisioningFailedReason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
129
+ v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition , infrav1 .LoadBalancerProvisioningFailedV1Beta1Reason , clusterv1 .ConditionSeverityWarning , "%s" , err .Error ())
130
130
conditions .Set (dockerCluster , metav1.Condition {
131
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
131
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
132
132
Status : metav1 .ConditionFalse ,
133
- Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableV1Beta2Reason ,
133
+ Reason : infrav1 .DevClusterDockerLoadBalancerNotAvailableReason ,
134
134
Message : fmt .Sprintf ("Failed to create helper for managing the externalLoadBalancer: %v" , err ),
135
135
})
136
136
@@ -140,12 +140,12 @@ func (r *ClusterBackEndReconciler) ReconcileDelete(ctx context.Context, cluster
140
140
// Set the LoadBalancerAvailableCondition reporting delete is started, and requeue in order to make
141
141
// this visible to the users.
142
142
// TODO (v1beta2): test for v1beta2 conditions
143
- if v1beta1conditions .GetReason (dockerCluster , infrav1 .LoadBalancerAvailableCondition ) != clusterv1 .DeletingV1Beta1Reason {
144
- v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , clusterv1 .DeletingV1Beta1Reason , clusterv1 .ConditionSeverityInfo , "" )
143
+ if v1beta1conditions .GetReason (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition ) != clusterv1 .DeletingV1Beta1Reason {
144
+ v1beta1conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableV1Beta1Condition , clusterv1 .DeletingV1Beta1Reason , clusterv1 .ConditionSeverityInfo , "" )
145
145
conditions .Set (dockerCluster , metav1.Condition {
146
- Type : infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
146
+ Type : infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
147
147
Status : metav1 .ConditionFalse ,
148
- Reason : infrav1 .DevClusterDockerLoadBalancerDeletingV1Beta2Reason ,
148
+ Reason : infrav1 .DevClusterDockerLoadBalancerDeletingReason ,
149
149
})
150
150
return ctrl.Result {RequeueAfter : 1 * time .Second }, nil
151
151
}
@@ -171,27 +171,27 @@ func (r *ClusterBackEndReconciler) PatchDevCluster(ctx context.Context, patchHel
171
171
// A step counter is added to represent progress during the provisioning process (instead we are hiding it during the deletion process).
172
172
v1beta1conditions .SetSummary (dockerCluster ,
173
173
v1beta1conditions .WithConditions (
174
- infrav1 .LoadBalancerAvailableCondition ,
174
+ infrav1 .LoadBalancerAvailableV1Beta1Condition ,
175
175
),
176
176
v1beta1conditions .WithStepCounterIf (dockerCluster .DeletionTimestamp .IsZero ()),
177
177
)
178
- if err := conditions .SetSummaryCondition (dockerCluster , dockerCluster , infrav1 .DevClusterReadyV1Beta2Condition ,
178
+ if err := conditions .SetSummaryCondition (dockerCluster , dockerCluster , infrav1 .DevClusterReadyCondition ,
179
179
conditions.ForConditionTypes {
180
- infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
180
+ infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
181
181
},
182
182
// Using a custom merge strategy to override reasons applied during merge.
183
183
conditions.CustomMergeStrategy {
184
184
MergeStrategy : conditions .DefaultMergeStrategy (
185
185
// Use custom reasons.
186
186
conditions .ComputeReasonFunc (conditions .GetDefaultComputeMergeReasonFunc (
187
- infrav1 .DevClusterNotReadyV1Beta2Reason ,
188
- infrav1 .DevClusterReadyUnknownV1Beta2Reason ,
189
- infrav1 .DevClusterReadyV1Beta2Reason ,
187
+ infrav1 .DevClusterNotReadyReason ,
188
+ infrav1 .DevClusterReadyUnknownReason ,
189
+ infrav1 .DevClusterReadyReason ,
190
190
)),
191
191
),
192
192
},
193
193
); err != nil {
194
- return errors .Wrapf (err , "failed to set %s condition" , infrav1 .DevClusterReadyV1Beta2Condition )
194
+ return errors .Wrapf (err , "failed to set %s condition" , infrav1 .DevClusterReadyCondition )
195
195
}
196
196
197
197
// Patch the object, ignoring conflicts on the conditions owned by this controller.
@@ -200,12 +200,12 @@ func (r *ClusterBackEndReconciler) PatchDevCluster(ctx context.Context, patchHel
200
200
dockerCluster ,
201
201
patch.WithOwnedV1Beta1Conditions {Conditions : []clusterv1.ConditionType {
202
202
clusterv1 .ReadyV1Beta1Condition ,
203
- infrav1 .LoadBalancerAvailableCondition ,
203
+ infrav1 .LoadBalancerAvailableV1Beta1Condition ,
204
204
}},
205
205
patch.WithOwnedConditions {Conditions : []string {
206
206
clusterv1 .PausedCondition ,
207
- infrav1 .DevClusterReadyV1Beta2Condition ,
208
- infrav1 .DevClusterDockerLoadBalancerAvailableV1Beta2Condition ,
207
+ infrav1 .DevClusterReadyCondition ,
208
+ infrav1 .DevClusterDockerLoadBalancerAvailableCondition ,
209
209
}},
210
210
)
211
211
}
0 commit comments