Skip to content

Commit dae9d89

Browse files
committed
removed version patches, updated helm workflow
1 parent 34db303 commit dae9d89

8 files changed

Lines changed: 30 additions & 27 deletions

File tree

pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104

105105
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
106106
- name: Get K8s context
107-
uses: azure/aks-set-context@v4.0.2
107+
uses: azure/aks-set-context@v4
108108
with:
109109
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
110110
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -128,15 +128,17 @@ jobs:
128128
result=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id)
129129
echo "Helm upgrade result: $result"
130130
exitCode=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id --query exitCode -o tsv)
131+
131132
if [ $exitCode -ne 0 ]; then
132133
exit $exitCode
133134
fi
134135
135136
- name: Deploy application on public cluster
136-
if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true'
137+
if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
137138
run: |
138-
if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then
139-
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}
140-
else
141-
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
142-
fi
139+
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
140+
141+
- name: Deploy application on fleet hub cluster
142+
if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }}
143+
run: |
144+
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}

pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103

104104
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
105105
- name: Get K8s context
106-
uses: azure/aks-set-context@v4.0.2
106+
uses: azure/aks-set-context@v4
107107
with:
108108
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
109109
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -129,7 +129,7 @@ jobs:
129129
130130
# Deploys application based on manifest files from previous step
131131
- name: Deploy application
132-
uses: Azure/k8s-deploy@v5.0.1
132+
uses: Azure/k8s-deploy@v5
133133
with:
134134
action: deploy
135135
manifests: ${{ steps.bake.outputs.manifestsBundle }}

pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898

9999
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
100100
- name: Get K8s context
101-
uses: azure/aks-set-context@v4.0.2
101+
uses: azure/aks-set-context@v4
102102
with:
103103
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
104104
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -116,7 +116,7 @@ jobs:
116116
117117
# Deploys application based on given manifest file
118118
- name: Deploys application
119-
uses: Azure/k8s-deploy@v5.0.1
119+
uses: Azure/k8s-deploy@v5
120120
with:
121121
action: deploy
122122
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}

pkg/handlers/templatetests/workflows_github_helm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestGitHubWorkflowHelmTemplates(t *testing.T) {
2222
"AZURECONTAINERREGISTRY": "testAcr",
2323
"CONTAINERNAME": "testContainer",
2424
"CLUSTERRESOURCEGROUP": "testClusterRG",
25-
"CLUSTERRESOURCETYPE": "managedClusters",
25+
"CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters",
2626
"CLUSTERNAME": "testCluster",
2727
"KUSTOMIZEPATH": "./overlays/production",
2828
"DEPLOYMENTMANIFESTPATH": "./manifests",

pkg/handlers/templatetests/workflows_github_kustomize_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestGitHubWorkflowKustomizeTemplates(t *testing.T) {
2222
"AZURECONTAINERREGISTRY": "testAcr",
2323
"CONTAINERNAME": "testContainer",
2424
"CLUSTERRESOURCEGROUP": "testClusterRG",
25-
"CLUSTERRESOURCETYPE": "managedClusters",
25+
"CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters",
2626
"CLUSTERNAME": "testCluster",
2727
"DEPLOYMENTMANIFESTPATH": "./manifests",
2828
"DOCKERFILE": "./Dockerfile",

template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ env:
4747
CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }}
4848
CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }}
4949
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
50-
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
50+
CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
5151
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
5252
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
5353
CHART_PATH: {{ .Config.GetVariableValue "CHARTPATH" }}
@@ -104,7 +104,7 @@ jobs:
104104

105105
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
106106
- name: Get K8s context
107-
uses: azure/aks-set-context@v4.0.2
107+
uses: azure/aks-set-context@v4
108108
with:
109109
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
110110
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -134,11 +134,12 @@ jobs:
134134
fi
135135
136136
- name: Deploy application on public cluster
137-
if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true'
137+
if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
138138
run: |
139-
if [ "${{ env.CLUSTER_RESOURCE_TYPE }}" == "Microsoft.ContainerService/fleets" ]; then
140-
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}
141-
else
142-
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
143-
fi
139+
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
140+
141+
- name: Deploy application on fleet hub cluster
142+
if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }}
143+
run: |
144+
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}
144145
`}}

template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ env:
4848
CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }}
4949
CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }}
5050
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
51-
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
51+
CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
5252
KUSTOMIZE_PATH: {{ .Config.GetVariableValue "KUSTOMIZEPATH" }}
5353
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
5454
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
@@ -103,7 +103,7 @@ jobs:
103103

104104
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
105105
- name: Get K8s context
106-
uses: azure/aks-set-context@v4.0.2
106+
uses: azure/aks-set-context@v4
107107
with:
108108
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
109109
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -129,7 +129,7 @@ jobs:
129129
130130
# Deploys application based on manifest files from previous step
131131
- name: Deploy application
132-
uses: Azure/k8s-deploy@v5.0.1
132+
uses: Azure/k8s-deploy@v5
133133
with:
134134
action: deploy
135135
manifests: ${{ steps.bake.outputs.manifestsBundle }}

template/workflows/manifests/.github/workflows/azure-kubernetes-service.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ env:
4343
CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }}
4444
CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }}
4545
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
46-
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/{{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
46+
CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
4747
DEPLOYMENT_MANIFEST_PATH: {{ .Config.GetVariableValue "DEPLOYMENTMANIFESTPATH" }}
4848
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
4949
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
@@ -98,7 +98,7 @@ jobs:
9898

9999
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
100100
- name: Get K8s context
101-
uses: azure/aks-set-context@v4.0.2
101+
uses: azure/aks-set-context@v4
102102
with:
103103
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
104104
cluster-name: ${{ env.CLUSTER_NAME }}
@@ -116,7 +116,7 @@ jobs:
116116
117117
# Deploys application based on given manifest file
118118
- name: Deploys application
119-
uses: Azure/k8s-deploy@v5.0.1
119+
uses: Azure/k8s-deploy@v5
120120
with:
121121
action: deploy
122122
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}

0 commit comments

Comments
 (0)