From 450b03e49e0893660868c1c8b446c59bd91e0123 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:38:13 -0500 Subject: [PATCH 1/3] cluster resource type --- .github/workflows/integration-per-language.yml | 1 - template/workflows/helm/draft.yaml | 8 ++++++++ template/workflows/kustomize/draft.yaml | 8 ++++++++ template/workflows/manifests/draft.yaml | 8 ++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index b635f6ae2..4286c4159 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -158,7 +158,6 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ - --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default diff --git a/template/workflows/helm/draft.yaml b/template/workflows/helm/draft.yaml index 987874936..912a9f1ca 100644 --- a/template/workflows/helm/draft.yaml +++ b/template/workflows/helm/draft.yaml @@ -94,3 +94,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" diff --git a/template/workflows/kustomize/draft.yaml b/template/workflows/kustomize/draft.yaml index 47bda64bf..2137fa144 100644 --- a/template/workflows/kustomize/draft.yaml +++ b/template/workflows/kustomize/draft.yaml @@ -78,3 +78,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" diff --git a/template/workflows/manifests/draft.yaml b/template/workflows/manifests/draft.yaml index b94698e70..f9c1b3e8a 100644 --- a/template/workflows/manifests/draft.yaml +++ b/template/workflows/manifests/draft.yaml @@ -78,3 +78,11 @@ variables: value: "false" description: "enable creation of target namespace if it does not exist" versions: ">=0.0.1" + - name: "CLUSTERRESOURCETYPE" + type: "string" + kind: "clusterResourceType" + default: + disablePrompt: true + value: "Microsoft.ContainerService/managedClusters" + description: "ARM resource type for cluster" + versions: ">=0.0.1" From b3d06938995ba8942627fe653513b7aa10582f56 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:48:25 -0500 Subject: [PATCH 2/3] add cluster type handler --- pkg/config/draftconfig_template_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/config/draftconfig_template_test.go b/pkg/config/draftconfig_template_test.go index b798a4a1d..f5251ba56 100644 --- a/pkg/config/draftconfig_template_test.go +++ b/pkg/config/draftconfig_template_test.go @@ -39,6 +39,7 @@ var validVariableKinds = map[string]bool{ "azureServiceConnection": true, "containerImageName": true, "containerImageVersion": true, + "clusterResourceType": true, "dirPath": true, "dockerFileName": true, "envVarMap": true, From a5b78a2fef5592d5288da2252099aea2bbbf0912 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Jan 2025 16:54:07 -0500 Subject: [PATCH 3/3] other deploy types --- .github/workflows/integration-per-language.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-per-language.yml b/.github/workflows/integration-per-language.yml index 4286c4159..6eb6d4a91 100644 --- a/.github/workflows/integration-per-language.yml +++ b/.github/workflows/integration-per-language.yml @@ -331,7 +331,6 @@ jobs: --variable CONTAINERNAME=someContainer \ --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ --variable CLUSTERNAME=someAksCluster \ - --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \ --variable DOCKERFILE=./Dockerfile \ --variable BUILDCONTEXTPATH=. \ --variable NAMESPACE=default @@ -485,7 +484,18 @@ jobs: curl -m 3 $SERVICEIP:${{env.serviceport}} sleep 5 kill $tunnelPID - - run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default + - run: ./draft -v generate-workflow\ + --deploy-type manifests\ + --variable WORKFLOWNAME=someWorkflow \ + --variable BRANCHNAME=main \ + --variable ACRRESOURCEGROUP=someAcrResourceGroup \ + --variable AZURECONTAINERREGISTRY=someRegistry \ + --variable CONTAINERNAME=someContainer \ + --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \ + --variable CLUSTERNAME=someAksCluster \ + --variable DOCKERFILE=./Dockerfile \ + --variable BUILDCONTEXTPATH=. \ + --variable NAMESPACE=default # Validate generated workflow yaml - name: Install action-validator with asdf uses: asdf-vm/actions/install@v1