From 2298efd06aa8c9f451abd086c4b4874d1d1a4878 Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Wed, 4 Dec 2024 17:53:26 +0000 Subject: [PATCH] Fix aks-console and aks-ssh commands --- Makefile | 10 ++++++---- global_config/production.sh | 1 - global_config/review.sh | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3ec1ec8..c1a62ff 100644 --- a/Makefile +++ b/Makefile @@ -140,12 +140,14 @@ get-cluster-credentials: set-azure-account kubelogin convert-kubeconfig -l $(if ${GITHUB_ACTIONS},spn,azurecli) aks-console: get-cluster-credentials - $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG_LONG))) - kubectl -n ${NAMESPACE} exec -ti --tty deployment/cpd-tsh-${APP_ID} -- /bin/sh -c "cd /app && bundle exec rails c" + $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG))) + $(eval NAMESPACE=$(shell jq -r '.namespace' terraform/application/config/${CONFIG}.tfvars.json)) + kubectl -n ${NAMESPACE} exec -ti deployment/cpd-tsh-${APP_ID} -- /bin/sh -c "cd /app && bundle exec rails c" aks-ssh: get-cluster-credentials - $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG_LONG))) - kubectl -n ${NAMESPACE} exec -ti --tty deployment/teaching-school-hub-finder-${APP_ID} -- /bin/sh + $(if $(PULL_REQUEST_NUMBER), $(eval export APP_ID=review-$(PULL_REQUEST_NUMBER)) , $(eval export APP_ID=$(CONFIG))) + $(eval NAMESPACE=$(shell jq -r '.namespace' terraform/application/config/${CONFIG}.tfvars.json)) + kubectl -n ${NAMESPACE} exec -ti deployment/cpd-tsh-${APP_ID} -- /bin/sh .PHONY: install-konduit install-konduit: ## Install the konduit script, for accessing backend services diff --git a/global_config/production.sh b/global_config/production.sh index 252c3a6..ad4dabb 100644 --- a/global_config/production.sh +++ b/global_config/production.sh @@ -4,6 +4,5 @@ CONFIG_SHORT=pd AZURE_SUBSCRIPTION=s189-teacher-services-cloud-production AZURE_RESOURCE_PREFIX=s189p01 ENABLE_KV_DIAGNOSTICS=true -CONFIG_LONG=production NAMESPACE=cpd-production TERRAFORM_MODULES_TAG=stable diff --git a/global_config/review.sh b/global_config/review.sh index 63a0ceb..6681eaf 100644 --- a/global_config/review.sh +++ b/global_config/review.sh @@ -4,6 +4,5 @@ CONFIG_SHORT=rv AZURE_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 KV_PURGE_PROTECTION=false -CONFIG_LONG=review NAMESPACE=cpd-review TERRAFORM_MODULES_TAG=main