From fc04edab9e13e693cad3cf0216a685b0aad44ea5 Mon Sep 17 00:00:00 2001 From: LaibaBareera Date: Mon, 2 Jun 2025 20:23:48 +0500 Subject: [PATCH] combine logic of label and providerId in isAKS function --- cmd/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/util.go b/cmd/util.go index 056b045..4ccddb2 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -505,6 +505,10 @@ func IsAKS(ctx context.Context, k8sClient kubernetes.Interface) (bool, error) { } node := nodes.Items[0] + labels := node.Labels + if _, exists := labels["kubernetes.azure.com/cluster"]; exists { + return true, nil + } if strings.HasPrefix(node.Spec.ProviderID, "azure://") { return true, nil