From 77e3f52bd8249e513fdedcce524ec3bcd6b64d64 Mon Sep 17 00:00:00 2001 From: kkb0318 Date: Thu, 18 Jul 2024 23:53:08 +0900 Subject: [PATCH] fix cleanup status --- api/v1alpha1/irsa_types.go | 2 +- internal/controller/irsa_controller.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/irsa_types.go b/api/v1alpha1/irsa_types.go index b6ade49..d6f47f3 100644 --- a/api/v1alpha1/irsa_types.go +++ b/api/v1alpha1/irsa_types.go @@ -184,7 +184,7 @@ func setStatusServiceAccounts(s *StatusServiceAccountList, namespacedName types. func removeStatusServiceAccounts(s *StatusServiceAccountList, namespacedName types.NamespacedName) { if s.IsExist(namespacedName) { - s.Append(namespacedName) + s.Delete(namespacedName) } } diff --git a/internal/controller/irsa_controller.go b/internal/controller/irsa_controller.go index e86c30f..df8f97c 100644 --- a/internal/controller/irsa_controller.go +++ b/internal/controller/irsa_controller.go @@ -205,7 +205,7 @@ func (r *IRSAReconciler) reconcile(ctx context.Context, obj *irsav1alpha1.IRSA, kubeClient, utils.DiffNamespacedNames(obj.Status.ServiceNamespacedNameList(), serviceAccount.NamespacedNameList()), ) - *obj = irsav1alpha1.IRSAStatusSetServiceAccount(*obj, deleted) + *obj = irsav1alpha1.IRSAStatusRemoveServiceAccount(*obj, deleted) if err != nil { e = err reason = irsav1alpha1.IRSAReasonFailedK8sCleanUp