@@ -80,12 +80,6 @@ func (r *DockerClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
80
80
log = log .WithValues ("Cluster" , klog .KObj (cluster ))
81
81
ctx = ctrl .LoggerInto (ctx , log )
82
82
83
- // Create a helper for managing a docker container hosting the loadbalancer.
84
- externalLoadBalancer , err := docker .NewLoadBalancer (ctx , cluster , dockerCluster )
85
- if err != nil {
86
- return ctrl.Result {}, errors .Wrapf (err , "failed to create helper for managing the externalLoadBalancer" )
87
- }
88
-
89
83
// Initialize the patch helper
90
84
patchHelper , err := patch .NewHelper (dockerCluster , r .Client )
91
85
if err != nil {
@@ -101,6 +95,13 @@ func (r *DockerClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
101
95
}
102
96
}()
103
97
98
+ // Create a helper for managing a docker container hosting the loadbalancer.
99
+ externalLoadBalancer , err := docker .NewLoadBalancer (ctx , cluster , dockerCluster )
100
+ if err != nil {
101
+ conditions .MarkFalse (dockerCluster , infrav1 .LoadBalancerAvailableCondition , infrav1 .LoadBalancerProvisioningFailedReason , clusterv1 .ConditionSeverityWarning , err .Error ())
102
+ return ctrl.Result {}, errors .Wrapf (err , "failed to create helper for managing the externalLoadBalancer" )
103
+ }
104
+
104
105
// Support FailureDomains
105
106
// In cloud providers this would likely look up which failure domains are supported and set the status appropriately.
106
107
// In the case of Docker, failure domains don't mean much so we simply copy the Spec into the Status.
0 commit comments