diff --git a/controllers/argocd/applicationset/deployment.go b/controllers/argocd/applicationset/deployment.go index 59920ccac..7e8932fb2 100644 --- a/controllers/argocd/applicationset/deployment.go +++ b/controllers/argocd/applicationset/deployment.go @@ -47,7 +47,7 @@ func (asr *ApplicationSetReconciler) reconcileDeployment() error { existingDeployment, err := workloads.GetDeployment(desiredDeployment.Name, desiredDeployment.Namespace, asr.Client) if err != nil { if !errors.IsNotFound(err) { - asr.Logger.Error(err, "reconcileDeployment: failed to retrieve deployment", "name", existingDeployment.Name, "namespace", existingDeployment.Namespace) + asr.Logger.Error(err, "reconcileDeployment: failed to retrieve deployment", "name", desiredDeployment.Name, "namespace", desiredDeployment.Namespace) return err } diff --git a/controllers/argocd/applicationset/role.go b/controllers/argocd/applicationset/role.go index 566643b4d..bd0877183 100644 --- a/controllers/argocd/applicationset/role.go +++ b/controllers/argocd/applicationset/role.go @@ -51,7 +51,7 @@ func (asr *ApplicationSetReconciler) reconcileRole() error { existingRole, err := permissions.GetRole(desiredRole.Name, desiredRole.Namespace, asr.Client) if err != nil { if !errors.IsNotFound(err) { - asr.Logger.Error(err, "reconcileRole: failed to retrieve role", "name", existingRole.Name, "namespace", existingRole.Namespace) + asr.Logger.Error(err, "reconcileRole: failed to retrieve role", "name", desiredRole.Name, "namespace", desiredRole.Namespace) return err } diff --git a/controllers/argocd/applicationset/rolebinding.go b/controllers/argocd/applicationset/rolebinding.go index f17f9a5ad..b9f75e2f5 100644 --- a/controllers/argocd/applicationset/rolebinding.go +++ b/controllers/argocd/applicationset/rolebinding.go @@ -61,7 +61,7 @@ func (asr *ApplicationSetReconciler) reconcileRoleBinding() error { existingRoleBinding, err := permissions.GetRoleBinding(desiredRoleBinding.Name, desiredRoleBinding.Namespace, asr.Client) if err != nil { if !errors.IsNotFound(err) { - asr.Logger.Error(err, "reconcileRoleBinding: failed to retrieve roleBinding", "name", existingRoleBinding.Name, "namespace", existingRoleBinding.Namespace) + asr.Logger.Error(err, "reconcileRoleBinding: failed to retrieve roleBinding", "name", desiredRoleBinding.Name, "namespace", desiredRoleBinding.Namespace) return err } diff --git a/controllers/argocd/applicationset/service.go b/controllers/argocd/applicationset/service.go index 91b8bdb9b..e1fd03279 100644 --- a/controllers/argocd/applicationset/service.go +++ b/controllers/argocd/applicationset/service.go @@ -48,10 +48,10 @@ func (asr *ApplicationSetReconciler) reconcileService() error { return err } - existingService, err := networking.GetService(desiredService.Name, desiredService.Namespace, asr.Client) + _, err = networking.GetService(desiredService.Name, desiredService.Namespace, asr.Client) if err != nil { if !errors.IsNotFound(err) { - asr.Logger.Error(err, "reconcileService: failed to retrieve service", "name", existingService.Name, "namespace", existingService.Namespace) + asr.Logger.Error(err, "reconcileService: failed to retrieve service", "name", desiredService.Name, "namespace", desiredService.Namespace) return err } diff --git a/controllers/argocd/applicationset/serviceaccount.go b/controllers/argocd/applicationset/serviceaccount.go index 6eaf3e3de..90fba1c00 100644 --- a/controllers/argocd/applicationset/serviceaccount.go +++ b/controllers/argocd/applicationset/serviceaccount.go @@ -36,10 +36,10 @@ func (asr *ApplicationSetReconciler) reconcileServiceAccount() error { return err } - existingServiceAccount, err := permissions.GetServiceAccount(desiredServiceAccount.Name, desiredServiceAccount.Namespace, asr.Client) + _, err = permissions.GetServiceAccount(desiredServiceAccount.Name, desiredServiceAccount.Namespace, asr.Client) if err != nil { if !errors.IsNotFound(err) { - asr.Logger.Error(err, "reconcileServiceAccount: failed to retrieve serviceAccount", "name", existingServiceAccount.Name, "namespace", existingServiceAccount.Namespace) + asr.Logger.Error(err, "reconcileServiceAccount: failed to retrieve serviceAccount", "name", desiredServiceAccount.Name, "namespace", desiredServiceAccount.Namespace) return err } diff --git a/controllers/argocd/notifications/configmap.go b/controllers/argocd/notifications/configmap.go index e1c2d1ca2..c0aeb30d5 100644 --- a/controllers/argocd/notifications/configmap.go +++ b/controllers/argocd/notifications/configmap.go @@ -43,10 +43,10 @@ func (nr *NotificationsReconciler) reconcileConfigMap() error { return err } - existingConfigMap, err := workloads.GetConfigMap(desiredConfigMap.Name, desiredConfigMap.Namespace, nr.Client) + _, err = workloads.GetConfigMap(desiredConfigMap.Name, desiredConfigMap.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileConfigMap: failed to retrieve configMap", "name", existingConfigMap.Name, "namespace", existingConfigMap.Namespace) + nr.Logger.Error(err, "reconcileConfigMap: failed to retrieve configMap", "name", desiredConfigMap.Name, "namespace", desiredConfigMap.Namespace) return err } diff --git a/controllers/argocd/notifications/deployment.go b/controllers/argocd/notifications/deployment.go index d9336cd67..a855195b3 100644 --- a/controllers/argocd/notifications/deployment.go +++ b/controllers/argocd/notifications/deployment.go @@ -47,7 +47,7 @@ func (nr *NotificationsReconciler) reconcileDeployment() error { existingDeployment, err := workloads.GetDeployment(desiredDeployment.Name, desiredDeployment.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileDeployment: failed to retrieve deployment", "name", existingDeployment.Name, "namespace", existingDeployment.Namespace) + nr.Logger.Error(err, "reconcileDeployment: failed to retrieve deployment", "name", desiredDeployment.Name, "namespace", desiredDeployment.Namespace) return err } diff --git a/controllers/argocd/notifications/role.go b/controllers/argocd/notifications/role.go index d2c8145a8..67fce554f 100644 --- a/controllers/argocd/notifications/role.go +++ b/controllers/argocd/notifications/role.go @@ -51,7 +51,7 @@ func (nr *NotificationsReconciler) reconcileRole() error { existingRole, err := permissions.GetRole(desiredRole.Name, desiredRole.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileRole: failed to retrieve role", "name", existingRole.Name, "namespace", existingRole.Namespace) + nr.Logger.Error(err, "reconcileRole: failed to retrieve role", "name", desiredRole.Name, "namespace", desiredRole.Namespace) return err } diff --git a/controllers/argocd/notifications/rolebinding.go b/controllers/argocd/notifications/rolebinding.go index b4f2d10ae..c076d7de0 100644 --- a/controllers/argocd/notifications/rolebinding.go +++ b/controllers/argocd/notifications/rolebinding.go @@ -61,7 +61,7 @@ func (nr *NotificationsReconciler) reconcileRoleBinding() error { existingRoleBinding, err := permissions.GetRoleBinding(desiredRoleBinding.Name, desiredRoleBinding.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileRoleBinding: failed to retrieve roleBinding", "name", existingRoleBinding.Name, "namespace", existingRoleBinding.Namespace) + nr.Logger.Error(err, "reconcileRoleBinding: failed to retrieve roleBinding", "name", desiredRoleBinding.Name, "namespace", desiredRoleBinding.Namespace) return err } diff --git a/controllers/argocd/notifications/secret.go b/controllers/argocd/notifications/secret.go index 38c2bb1b8..4f1577a0e 100644 --- a/controllers/argocd/notifications/secret.go +++ b/controllers/argocd/notifications/secret.go @@ -44,10 +44,10 @@ func (nr *NotificationsReconciler) reconcileSecret() error { return err } - existingSecret, err := workloads.GetSecret(desiredSecret.Name, desiredSecret.Namespace, nr.Client) + _, err = workloads.GetSecret(desiredSecret.Name, desiredSecret.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileSecret: failed to retrieve secret", "name", existingSecret.Name, "namespace", existingSecret.Namespace) + nr.Logger.Error(err, "reconcileSecret: failed to retrieve secret", "name", desiredSecret.Name, "namespace", desiredSecret.Namespace) return err } diff --git a/controllers/argocd/notifications/serviceaccount.go b/controllers/argocd/notifications/serviceaccount.go index f81fad589..b45472cf1 100644 --- a/controllers/argocd/notifications/serviceaccount.go +++ b/controllers/argocd/notifications/serviceaccount.go @@ -36,10 +36,10 @@ func (nr *NotificationsReconciler) reconcileServiceAccount() error { return err } - existingServiceAccount, err := permissions.GetServiceAccount(desiredServiceAccount.Name, desiredServiceAccount.Namespace, nr.Client) + _, err = permissions.GetServiceAccount(desiredServiceAccount.Name, desiredServiceAccount.Namespace, nr.Client) if err != nil { if !errors.IsNotFound(err) { - nr.Logger.Error(err, "reconcileServiceAccount: failed to retrieve serviceAccount", "name", existingServiceAccount.Name, "namespace", existingServiceAccount.Namespace) + nr.Logger.Error(err, "reconcileServiceAccount: failed to retrieve serviceAccount", "name", desiredServiceAccount.Name, "namespace", desiredServiceAccount.Namespace) return err }