Skip to content

Commit a9d3c00

Browse files
committed
Fix fleet example
Signed-off-by: Iván Álvarez <[email protected]>
1 parent 9391114 commit a9d3c00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/fleet/main.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func main() {
9797
if err := client.Get(ctx, req.NamespacedName, pod); err != nil {
9898
return reconcile.Result{}, err
9999
}
100-
log.Info("Reconciling pod", "ns", pod.GetNamespace(), "name", pod.Name, "uuid", pod.UID)
100+
log.Info("Reconciling pod", "cluster", cl.Name(), "ns", pod.GetNamespace(), "name", pod.Name, "uuid", pod.UID)
101101

102102
// Print any annotations that start with fleet.
103103
for k, v := range pod.Labels {
@@ -171,6 +171,7 @@ func (k *KindClusterProvider) Run(ctx context.Context, mgr manager.Manager) erro
171171
}
172172
k.lock.RLock()
173173
if _, ok := k.clusters[clusterName]; ok {
174+
k.lock.RUnlock()
174175
continue
175176
}
176177
k.lock.RUnlock()
@@ -247,6 +248,8 @@ func (k *KindClusterProvider) Run(ctx context.Context, mgr manager.Manager) erro
247248
delete(k.clusters, name)
248249
delete(k.cancelFns, name)
249250
k.lock.Unlock()
251+
252+
k.log.Info("Cluster removed", "cluster", name)
250253
}
251254
}
252255

0 commit comments

Comments
 (0)