From e8b31da64a3bddda4e9a7d14de2b9877018620b7 Mon Sep 17 00:00:00 2001 From: Martin Weindel Date: Fri, 26 Jul 2024 09:56:45 +0200 Subject: [PATCH] replace ParseObjectName --- pkg/controller/lifecycle/actuator.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/controller/lifecycle/actuator.go b/pkg/controller/lifecycle/actuator.go index 5a027aad..5526768a 100644 --- a/pkg/controller/lifecycle/actuator.go +++ b/pkg/controller/lifecycle/actuator.go @@ -713,17 +713,18 @@ func (a *actuator) collectProviderDetailsOnDeletingDNSEntries(ctx context.Contex status = append(status, "no suitable provider") continue } - namespace, name := kutil.ParseObjectName(k) - if namespace == "" { + parts := strings.Split(k, "/") + if len(parts) != 2 { status = append(status, fmt.Sprintf("unknown provider name: %s", k)) continue } + objectKey := client.ObjectKey{Namespace: parts[0], Name: parts[1]} provider := &dnsv1alpha1.DNSProvider{} - if err := a.Client().Get(ctx, client.ObjectKey{Namespace: namespace, Name: name}, provider); err != nil { + if err := a.Client().Get(ctx, objectKey, provider); err != nil { status = append(status, fmt.Sprintf("error on retrieving status of provider %s: %s", k, err)) continue } - status = append(status, fmt.Sprintf("provider %s has status: %s", name, ptr.Deref(provider.Status.Message, "unknwon"))) + status = append(status, fmt.Sprintf("provider %s has status: %s", objectKey, ptr.Deref(provider.Status.Message, "unknwon"))) } return strings.Join(status, ", ") }