Skip to content

Commit e213e62

Browse files
committed
added label selector logs
1 parent 1d782bf commit e213e62

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

controllers/argocd/argocd_controller.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,18 @@ func (r *ReconcileArgoCD) Reconcile(ctx context.Context, request ctrl.Request) (
107107
// Error reading the object - requeue the request.
108108
return reconcile.Result{}, err
109109
}
110+
//debug line
111+
fmt.Println(r.LabelSelector)
110112

111113
// Fetch labelSelector from r.LabelSelector (command-line option)
112114
labelSelector, err := labels.Parse(r.LabelSelector)
113115
if err != nil {
114-
reqLogger.Info("error parsing the labelSelector '%s'.", labelSelector)
116+
reqLogger.Info(fmt.Sprintf("error parsing the labelSelector '%s'.", labelSelector))
115117
return reconcile.Result{}, err
116118
}
117-
118119
// Match the value of labelSelector from ReconcileArgoCD to labels from the argocd instance
119120
if !labelSelector.Matches(labels.Set(argocd.Labels)) {
120-
reqLogger.Info("the ArgoCD instance does not match the label selector %s and skipping for reconcillation", r.LabelSelector)
121+
reqLogger.Info(fmt.Sprintf("the ArgoCD instance does not match the label selector '%s' and skipping for reconcillation", r.LabelSelector))
121122
return reconcile.Result{}, nil
122123
}
123124

main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func main() {
104104
setupLog.Info("error parsing the labelSelector '%s'.", labelSelectorFlag)
105105
os.Exit(1)
106106
}
107+
setupLog.Info(fmt.Sprintf("Watching labelselector \"%s\"", labelSelectorFlag))
107108

108109
// Inspect cluster to verify availability of extra features
109110
if err := argocd.InspectCluster(); err != nil {
@@ -194,7 +195,8 @@ func main() {
194195
os.Exit(1)
195196
}
196197
}
197-
198+
setupLog.Info("AAAAAAAAAAA0")
199+
setupLog.Info(labelSelectorFlag)
198200
if err = (&argocd.ReconcileArgoCD{
199201
Client: mgr.GetClient(),
200202
Scheme: mgr.GetScheme(),

0 commit comments

Comments
 (0)