@@ -173,7 +173,10 @@ func (r *KubeadmConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reques
173173 if configOwner == nil {
174174 return ctrl.Result {}, nil
175175 }
176- log = log .WithValues (configOwner .LowerCamelCaseKind (), klog .KRef (configOwner .GetNamespace (), configOwner .GetName ()), "resourceVersion" , configOwner .GetResourceVersion ())
176+ log = log .WithValues (configOwner .GetKind (), klog .KRef (configOwner .GetNamespace (), configOwner .GetName ()), "resourceVersion" , configOwner .GetResourceVersion ())
177+
178+ log = log .WithValues ("Cluster" , klog .KRef (configOwner .GetNamespace (), configOwner .ClusterName ()))
179+ ctx = ctrl .LoggerInto (ctx , log )
177180
178181 // Lookup the cluster the config owner is associated with
179182 cluster , err := util .GetClusterByName (ctx , r .Client , configOwner .GetNamespace (), configOwner .ClusterName ())
@@ -191,8 +194,6 @@ func (r *KubeadmConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reques
191194 return ctrl.Result {}, err
192195 }
193196
194- ctx = ctrl .LoggerInto (ctx , log .WithValues ("cluster" , klog .KObj (cluster )))
195-
196197 if annotations .IsPaused (cluster , config ) {
197198 log .Info ("Reconciliation is paused for this object" )
198199 return ctrl.Result {}, nil
@@ -1001,7 +1002,7 @@ func (r *KubeadmConfigReconciler) storeBootstrapData(ctx context.Context, scope
10011002 if ! apierrors .IsAlreadyExists (err ) {
10021003 return errors .Wrapf (err , "failed to create bootstrap data secret for KubeadmConfig %s/%s" , scope .Config .Namespace , scope .Config .Name )
10031004 }
1004- log .Info ("bootstrap data secret for KubeadmConfig already exists, updating" , "secret " , klog .KObj (secret ))
1005+ log .Info ("bootstrap data secret for KubeadmConfig already exists, updating" , "Secret " , klog .KObj (secret ))
10051006 if err := r .Client .Update (ctx , secret ); err != nil {
10061007 return errors .Wrapf (err , "failed to update bootstrap data secret for KubeadmConfig %s/%s" , scope .Config .Namespace , scope .Config .Name )
10071008 }
0 commit comments