Skip to content

Commit

Permalink
Merge pull request #1037 from Azure/other-dry-runs
Browse files Browse the repository at this point in the history
Add Dry run for Cluster service
  • Loading branch information
janboll authored Jan 7, 2025
2 parents ac5667e + 0017d12 commit ecac39d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/services-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@
run: |
helm plugin install https://github.com/databus23/helm-diff
- name: 'Deploy Frontend'
- name: 'Dry Run Cluster Service'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make frontend.dry_run
make cluster-service.dry_run
- name: 'Deploy Backend'
- name: 'Dry Run Backend'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make backend.dry_run
- name: 'Dry Run Frontend'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make frontend.dry_run
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ infra.clean:
# separator "/" (used for maestro only).

# Services deployed on "svc" aks cluster
services_svc = istio metrics maestro.server maestro.registration cluster-service
services_svc = istio metrics maestro.server maestro.registration
# Services deployed on "mgmt" aks cluster(s)
services_mgmt = acm maestro.agent pko hypershiftoperator
# List of all services
Expand All @@ -124,7 +124,7 @@ services_all = $(join services_svc,services_mgmt)
# Pipelines section
# This sections is used to reference pipeline runs and should replace
# the usage of `svc-deploh.sh` script in the future.
services_svc_pipelines = backend frontend
services_svc_pipelines = backend frontend cluster-service
%.deploy:
$(eval export dirname=$(subst .,/,$(basename $@)))
./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public
Expand Down
4 changes: 3 additions & 1 deletion cluster-service/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

ZONE_NAME ?= "${REGIONAL_DNS_SUBDOMAIN}.${BASE_DNS_ZONE_NAME}"

Expand All @@ -21,7 +23,7 @@ deploy: provision-shard
OP_FILE_CSI_DRIVER_ROLE_ID=$(shell az role definition list --name "${OP_FILE_CSI_DRIVER_ROLE_NAME}" --query "[].name" -o tsv) && \
OP_IMAGE_REGISTRY_DRIVER_ROLE_ID=$(shell az role definition list --name "${OP_IMAGE_REGISTRY_DRIVER_ROLE_NAME}" --query "[].name" -o tsv) && \
OP_CLOUD_NETWORK_CONFIG_ROLE_ID=$(shell az role definition list --name "${OP_CLOUD_NETWORK_CONFIG_ROLE_NAME}" --query "[].name" -o tsv) && \
helm upgrade --install --wait ${HELM_DRY_RUN} cluster-service deploy/helm \
${HELM_CMD} cluster-service deploy/helm \
--namespace cluster-service \
-f deploy/helm/$${OVERRIDES} \
--set azureCsMiClientId=$${AZURE_CS_MI_CLIENT_ID} \
Expand Down
6 changes: 2 additions & 4 deletions cluster-service/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ resourceGroups:
command: make deploy
dryRun:
variables:
- name: HELM_DRY_RUN
value: "--dry-run=server --debug"
- name: KUBECTL_DRY_RUN
value: "--dry-run=server"
- name: DRY_RUN
value: "true"
variables:
- name: REGION
configRef: region
Expand Down
1 change: 1 addition & 0 deletions tooling/templatize/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func main() {

if err := cmd.Execute(); err != nil {
logger.Error(err, "command failed")
os.Exit(1)
}
}

Expand Down

0 comments on commit ecac39d

Please sign in to comment.