From 238555fea004a9ed7d498cb265b09e158017cf11 Mon Sep 17 00:00:00 2001 From: Suneha Bose Date: Tue, 13 Aug 2024 12:04:11 -0700 Subject: [PATCH 1/2] fix for namespace --- .../helm/charts/templates/namespace.yaml | 13 ------------- .../workflows/azure-kubernetes-service-helm.yml | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 template/deployments/helm/charts/templates/namespace.yaml diff --git a/template/deployments/helm/charts/templates/namespace.yaml b/template/deployments/helm/charts/templates/namespace.yaml deleted file mode 100644 index 8c23da076..000000000 --- a/template/deployments/helm/charts/templates/namespace.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if ne .Values.namespace "default" }} -kind: Namespace -apiVersion: v1 -metadata: - name: {{ .Values.namespace }} - labels: - {{- include "{{APPNAME}}.labels" . | nindent 4 }} - openservicemesh.io/monitored-by: osm - kubernetes.azure.com/generator: {{GENERATORLABEL}} - annotations: - openservicemesh.io/sidecar-injection: enabled -{{- end }} - diff --git a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml index 23cf13e1e..9695ac8a8 100644 --- a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -120,7 +120,7 @@ jobs: - name: Deploy application on private cluster if : steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' run: | - command_id=$(az aks command invoke --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command "helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{env.NAMESPACE}} --timeout 240s" --file . --query id -o tsv) + command_id=$(az aks command invoke --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command "helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace --timeout 240s" --file . --query id -o tsv) result=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id) echo "Helm upgrade result: $result" exitCode=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id --query exitCode -o tsv) @@ -131,5 +131,5 @@ jobs: - name: Deploy application on public cluster if : steps.isPrivate.outputs.PRIVATE_CLUSTER == '' - run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace `}} From d80514a26799407678790a76f1b86ef1c23f80f4 Mon Sep 17 00:00:00 2001 From: Suneha Bose Date: Wed, 29 Jan 2025 10:50:05 -0800 Subject: [PATCH 2/2] remove parentheses --- CHANGELOG.md | 11 +++++++++++ .../workflows/azure-kubernetes-service-helm.yml | 4 +++- .../workflows/azure-kubernetes-service-helm.yml | 4 +++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e2506b88..c0b468133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## [0.17.2] - 2025-01-27 + +### Added + +- [476](https://github.com/Azure/draft/pull/476) Added default value for CLUSTERRESOURCETYPE in draft.yaml + +### Fixed + +- [477](https://github.com/Azure/draft/pull/477) Explicitly require jobs for each language to allow failure to be reported and prevent PR merging in case of a failure +- [479](https://github.com/Azure/draft/pull/479) Remove helm `wait` flag for fleet clusters + ## [0.17.1] - 2025-01-24 ### Added diff --git a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml index 3b3f14a20..e42604a12 100644 --- a/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -147,5 +147,7 @@ jobs: - name: Deploy application on public cluster if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' }} + env: + WAIT_FLAG: ${{ (env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets') && '--wait' || '' }} # don't wait for fleet hubs run: | - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + helm upgrade ${{ env.WAIT_FLAG }} -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} diff --git a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml index ba72ebefb..fdbdda2f2 100644 --- a/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml +++ b/template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml @@ -147,6 +147,8 @@ jobs: - name: Deploy application on public cluster if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' }} + env: + WAIT_FLAG: ${{ (env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets') && '--wait' || '' }} # don't wait for fleet hubs run: | - helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} + helm upgrade ${{ env.WAIT_FLAG }} -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} `}}