diff --git a/test/go.mod b/test/go.mod index 20c5f3569d5..6b60317005d 100644 --- a/test/go.mod +++ b/test/go.mod @@ -70,7 +70,7 @@ require ( cloud.google.com/go/monitoring v1.24.3 // indirect cloud.google.com/go/storage v1.62.1 // indirect dario.cat/mergo v1.0.1 // indirect - github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 // indirect + github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 // indirect github.com/Azure/ARO-Tools/tools/cmdutils v0.0.0-20260715002326-2555e1130350 // indirect github.com/Azure/ARO-Tools/tools/grafanactl v0.0.0-20260715002326-2555e1130350 // indirect github.com/Azure/ARO-Tools/tools/helm v0.0.0-20260715002326-2555e1130350 // indirect diff --git a/test/go.sum b/test/go.sum index 66870ae2a81..60f0a78fb7c 100644 --- a/test/go.sum +++ b/test/go.sum @@ -69,8 +69,8 @@ github.com/Azure/ARO-HCP/backend v0.0.0-20260513195720-7c0637c01c58 h1:GS9DvICq1 github.com/Azure/ARO-HCP/backend v0.0.0-20260513195720-7c0637c01c58/go.mod h1:/0GqqOcoDf58ozMxUvx2BN8i9KUN28EzhNdpTMSejW8= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350 h1:HcxeG/aUrC+dEQHQuUAFuWeUjrInvtoLg4VZoB27WpI= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350/go.mod h1:lHUKixOUw8Wn/x3JC7VVLwlGDC4hD4wTUfYbT249yKM= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 h1:WkyGoNXxBikToHAKiKwmPyfCmuyQR/D/0w4e2ko+63Y= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 h1:0WvIjAhHuy9fwjUbHcQX3MoyiQgGgh9dr95N7SfkY40= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350 h1:BT7jXSF8pldP/zgiMAHXajS9d1crVlZYqyT3kyK/YBA= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350/go.mod h1:vKa6bvu+tFVip4oWO9PNI2NbtmN1KUezvdX7rZCQtQU= github.com/Azure/ARO-Tools/tools/cmdutils v0.0.0-20260715002326-2555e1130350 h1:OKEEHnv7jJhynBgOkRTTNvKt2Nq5KyiCAeu9kx+RM24= diff --git a/tooling/helmtest/go.mod b/tooling/helmtest/go.mod index 30e3e44f26d..f4c9ee0ef3f 100644 --- a/tooling/helmtest/go.mod +++ b/tooling/helmtest/go.mod @@ -4,7 +4,7 @@ go 1.25.7 require ( github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350 - github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 + github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350 github.com/google/go-cmp v0.7.0 github.com/stretchr/testify v1.11.1 diff --git a/tooling/helmtest/go.sum b/tooling/helmtest/go.sum index df31d0d8406..f529b5f40b3 100644 --- a/tooling/helmtest/go.sum +++ b/tooling/helmtest/go.sum @@ -8,8 +8,8 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350 h1:HcxeG/aUrC+dEQHQuUAFuWeUjrInvtoLg4VZoB27WpI= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350/go.mod h1:lHUKixOUw8Wn/x3JC7VVLwlGDC4hD4wTUfYbT249yKM= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 h1:WkyGoNXxBikToHAKiKwmPyfCmuyQR/D/0w4e2ko+63Y= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 h1:0WvIjAhHuy9fwjUbHcQX3MoyiQgGgh9dr95N7SfkY40= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350 h1:BT7jXSF8pldP/zgiMAHXajS9d1crVlZYqyT3kyK/YBA= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350/go.mod h1:vKa6bvu+tFVip4oWO9PNI2NbtmN1KUezvdX7rZCQtQU= github.com/Azure/ARO-Tools/tools/cmdutils v0.0.0-20260715002326-2555e1130350 h1:OKEEHnv7jJhynBgOkRTTNvKt2Nq5KyiCAeu9kx+RM24= diff --git a/tooling/pipeline-documentation/go.mod b/tooling/pipeline-documentation/go.mod index 0f6091c07c0..674cedf1df7 100644 --- a/tooling/pipeline-documentation/go.mod +++ b/tooling/pipeline-documentation/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/ARO-HCP/tooling/pipeline-documentation go 1.25.7 require ( - github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 + github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 github.com/dusted-go/logging v1.3.0 github.com/go-logr/logr v1.4.3 github.com/spf13/cobra v1.10.2 diff --git a/tooling/pipeline-documentation/go.sum b/tooling/pipeline-documentation/go.sum index ed45dda0c31..bae8d8cb102 100644 --- a/tooling/pipeline-documentation/go.sum +++ b/tooling/pipeline-documentation/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 h1:WkyGoNXxBikToHAKiKwmPyfCmuyQR/D/0w4e2ko+63Y= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 h1:0WvIjAhHuy9fwjUbHcQX3MoyiQgGgh9dr95N7SfkY40= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/dusted-go/logging v1.3.0 h1:SL/EH1Rp27oJQIte+LjWvWACSnYDTqNx5gZULin0XRY= github.com/dusted-go/logging v1.3.0/go.mod h1:s58+s64zE5fxSWWZfp+b8ZV0CHyKHjamITGyuY1wzGg= diff --git a/tooling/templatize/go.mod b/tooling/templatize/go.mod index 84af9d3407f..1c2f1b2b7fa 100644 --- a/tooling/templatize/go.mod +++ b/tooling/templatize/go.mod @@ -5,7 +5,7 @@ go 1.25.7 require ( github.com/Azure/ARO-HCP/tooling/cleanup-sweeper v0.0.0-20260409032928-501433c68f7d github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350 - github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 + github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350 github.com/Azure/ARO-Tools/tools/cmdutils v0.0.0-20260715002326-2555e1130350 github.com/Azure/ARO-Tools/tools/grafanactl v0.0.0-20260715002326-2555e1130350 diff --git a/tooling/templatize/go.sum b/tooling/templatize/go.sum index 6c61e3753fe..e100861eaaa 100644 --- a/tooling/templatize/go.sum +++ b/tooling/templatize/go.sum @@ -69,8 +69,8 @@ github.com/Azure/ARO-HCP/tooling/cleanup-sweeper v0.0.0-20260409032928-501433c68 github.com/Azure/ARO-HCP/tooling/cleanup-sweeper v0.0.0-20260409032928-501433c68f7d/go.mod h1:rVUpgSjxc+ODZ9g745QpuCtC/UqNk1Q2bYBHqtwH43A= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350 h1:HcxeG/aUrC+dEQHQuUAFuWeUjrInvtoLg4VZoB27WpI= github.com/Azure/ARO-Tools/config v0.0.0-20260715002326-2555e1130350/go.mod h1:lHUKixOUw8Wn/x3JC7VVLwlGDC4hD4wTUfYbT249yKM= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350 h1:WkyGoNXxBikToHAKiKwmPyfCmuyQR/D/0w4e2ko+63Y= -github.com/Azure/ARO-Tools/pipelines v0.0.0-20260715002326-2555e1130350/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707 h1:0WvIjAhHuy9fwjUbHcQX3MoyiQgGgh9dr95N7SfkY40= +github.com/Azure/ARO-Tools/pipelines v0.0.0-20260720175808-ca2cea2cb707/go.mod h1:WPsexqTqWP0/yJTOXhvVMfTrK73SXofVUE0XMudAnt8= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350 h1:BT7jXSF8pldP/zgiMAHXajS9d1crVlZYqyT3kyK/YBA= github.com/Azure/ARO-Tools/testutil v0.0.0-20260715002326-2555e1130350/go.mod h1:vKa6bvu+tFVip4oWO9PNI2NbtmN1KUezvdX7rZCQtQU= github.com/Azure/ARO-Tools/tools/cmdutils v0.0.0-20260715002326-2555e1130350 h1:OKEEHnv7jJhynBgOkRTTNvKt2Nq5KyiCAeu9kx+RM24= diff --git a/tooling/templatize/pkg/pipeline/istio.go b/tooling/templatize/pkg/pipeline/istio.go index 55c481ad0f1..7623c602a45 100644 --- a/tooling/templatize/pkg/pipeline/istio.go +++ b/tooling/templatize/pkg/pipeline/istio.go @@ -37,15 +37,27 @@ func configString(val any) string { return fmt.Sprintf("%v", val) } -func runIstioUpgradeStep(id graph.Identifier, step *types.IstioUpgradeStep, ctx context.Context, options *StepRunOptions, executionTarget ExecutionTarget) error { +func runIstioUpgradeStep(id graph.Identifier, step *types.IstioUpgradeStep, ctx context.Context, options *StepRunOptions, executionTarget ExecutionTarget, state *ExecutionState) error { logger := logr.FromContextOrDiscard(ctx).WithValues("stepID", id) - kubeconfigFile, err := KubeConfig(ctx, executionTarget.GetSubscriptionID(), executionTarget.GetResourceGroup(), step.AKSCluster) + state.RLock() + outputs := state.GetOutputs(id.Stamp) + state.RUnlock() + + clusterName, err := resolveValue(step.AKSCluster, options.Configuration, outputs, id.ServiceGroup) + if err != nil { + return fmt.Errorf("failed to resolve aksCluster: %w", err) + } + if clusterName == "" { + return fmt.Errorf("aksCluster resolved to an empty value") + } + + kubeconfigFile, err := KubeConfig(ctx, executionTarget.GetSubscriptionID(), executionTarget.GetResourceGroup(), clusterName) if err != nil { return fmt.Errorf("failed to prepare kubeconfig: %w", err) } if kubeconfigFile == "" { - return fmt.Errorf("kubeconfig resolved to empty path for cluster %s", step.AKSCluster) + return fmt.Errorf("kubeconfig resolved to empty path for cluster %s", clusterName) } defer func() { if err := os.Remove(kubeconfigFile); err != nil { @@ -83,13 +95,12 @@ func runIstioUpgradeStep(id graph.Identifier, step *types.IstioUpgradeStep, ctx opts := istio.DefaultUpgradeOptions() opts.ResourceGroup = executionTarget.GetResourceGroup() - opts.ClusterName = step.AKSCluster + opts.ClusterName = clusterName opts.KubeconfigPath = kubeconfigFile opts.Versions = configString(versions) opts.Tag = configString(tag) opts.IngressIPName = configString(ipName) opts.RegionRG = configString(regionRG) - opts.DryRun = step.DryRun return istio.RunUpgrade(ctx, opts, aksClient, kubeClient) } diff --git a/tooling/templatize/pkg/pipeline/run.go b/tooling/templatize/pkg/pipeline/run.go index 1b7a592ca2f..03a1be7f583 100644 --- a/tooling/templatize/pkg/pipeline/run.go +++ b/tooling/templatize/pkg/pipeline/run.go @@ -981,7 +981,7 @@ func RunStep(id graph.Identifier, s types.Step, ctx context.Context, executionTa } return output, details, nil case *types.IstioUpgradeStep: - if err := runIstioUpgradeStep(id, step, ctx, options, executionTarget); err != nil { + if err := runIstioUpgradeStep(id, step, ctx, options, executionTarget, state); err != nil { return nil, nil, fmt.Errorf("failed to run istio upgrade step: %w", err) } return nil, nil, nil