1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2025-07-31 19:08:07 +00:00

combine logic of label and providerId in isAKS function

This commit is contained in:
LaibaBareera 2025-06-02 20:23:48 +05:00
parent db04033730
commit fc04edab9e

View File

@ -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