Skip to content

Commit

Permalink
Fix fleet example
Browse files Browse the repository at this point in the history
Signed-off-by: Iván Álvarez <ivanape@inditex.com>
  • Loading branch information
ivanape committed May 27, 2024
1 parent 9391114 commit a9d3c00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/fleet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func main() {
if err := client.Get(ctx, req.NamespacedName, pod); err != nil {
return reconcile.Result{}, err
}
log.Info("Reconciling pod", "ns", pod.GetNamespace(), "name", pod.Name, "uuid", pod.UID)
log.Info("Reconciling pod", "cluster", cl.Name(), "ns", pod.GetNamespace(), "name", pod.Name, "uuid", pod.UID)

// Print any annotations that start with fleet.
for k, v := range pod.Labels {
Expand Down Expand Up @@ -171,6 +171,7 @@ func (k *KindClusterProvider) Run(ctx context.Context, mgr manager.Manager) erro
}
k.lock.RLock()
if _, ok := k.clusters[clusterName]; ok {
k.lock.RUnlock()
continue
}
k.lock.RUnlock()
Expand Down Expand Up @@ -247,6 +248,8 @@ func (k *KindClusterProvider) Run(ctx context.Context, mgr manager.Manager) erro
delete(k.clusters, name)
delete(k.cancelFns, name)
k.lock.Unlock()

k.log.Info("Cluster removed", "cluster", name)
}
}

Expand Down

0 comments on commit a9d3c00

Please sign in to comment.