From 80eb14cb075de4405050f9045e56be85a3cc4875 Mon Sep 17 00:00:00 2001 From: kksat <22549266+kksat@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:46:15 +0200 Subject: [PATCH] add makefile target to login to created ARO Signed-off-by: kksat <22549266+kksat@users.noreply.github.com> --- bicep.makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bicep.makefile b/bicep.makefile index 06b6d69..dd6d8fd 100644 --- a/bicep.makefile +++ b/bicep.makefile @@ -64,3 +64,9 @@ aro-url: ## Get ARO URL .PHONY: domain-zone-exists domain-zone-exists: ## Fail if DNS domain zone does not exists ARO_DOMAIN=${ARO_DOMAIN} hack/domain-zone-exists.sh + +.PHONY: oc-login +oc-login: ## Login with oc to existing ARO cluster + oc login "$(shell az aro show --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query "apiserverProfile.url" -o tsv)" \ + -u "$(shell az aro list-credentials --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query 'kubeadminUsername' -o tsv)" \ + -p "$(shell az aro list-credentials --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query 'kubeadminPassword' -o tsv)"