diff --git a/backend/.gitignore b/backend/.gitignore index aee2e4ce1..e69de29bb 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1 +0,0 @@ -config.mk diff --git a/backend/config.tmpl.mk b/backend/config.tmpl.mk deleted file mode 100644 index 9c0833c7f..000000000 --- a/backend/config.tmpl.mk +++ /dev/null @@ -1,5 +0,0 @@ -ARO_HCP_IMAGE_ACR ?= {{ .svcAcrName }} -LOCATION ?= {{ .region }} -RESOURCEGROUP ?= {{ .svc.rg }} -AKS_NAME ?= {{ .aksName }} -DB_NAME ?= {{ .frontend.cosmosDB.name }} diff --git a/config/config.yaml b/config/config.yaml index c9a7be07f..84c97a237 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -149,7 +149,6 @@ clouds: etcd: kvSoftDelete: false mgmt: - subscription: ARO Hosted Control Planes (EA Subscription 1) # MGMTM AKS nodepools - big enough for 2 HCPs systemAgentPool: minCount: 1 diff --git a/dev-infrastructure/svc-pipeline.yaml b/dev-infrastructure/svc-pipeline.yaml index 7a79b4c8b..e62f086b9 100644 --- a/dev-infrastructure/svc-pipeline.yaml +++ b/dev-infrastructure/svc-pipeline.yaml @@ -24,4 +24,4 @@ resourceGroups: - name: GRAFANA_NAME configRef: grafanaName dependsOn: - - region + - svc diff --git a/frontend/.gitignore b/frontend/.gitignore index aee2e4ce1..e69de29bb 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1 +0,0 @@ -config.mk diff --git a/frontend/Makefile b/frontend/Makefile index 777c57805..c7931a934 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,6 +1,6 @@ -SHELL = /bin/bash +include ../setup-env.mk -COMMIT = $(shell git rev-parse --short=7 HEAD) +COMMIT ?= $(shell git rev-parse --short=7 HEAD) ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpfrontend:$(COMMIT) @@ -16,6 +16,7 @@ run: clean: rm -f aro-hcp-frontend +.PHONY: clean build-push: image push @@ -23,18 +24,19 @@ image: pushd .. && git archive --output frontend/archive.tar.gz HEAD && popd docker build -f "./Dockerfile" -t ${ARO_HCP_FRONTEND_IMAGE} . rm -f archive.tar.gz +.PHONY: image push: image az acr login --name ${ARO_HCP_IMAGE_ACR} docker push ${ARO_HCP_FRONTEND_IMAGE} deploy: - FRONTEND_MI_CLIENT_ID=$(shell az identity show \ + FRONTEND_MI_CLIENT_ID=$$(az identity show \ -g ${RESOURCEGROUP} \ -n frontend \ --query clientId);\ - ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \ - DB_URL=$(shell az cosmosdb show -n ${DB_NAME} -g ${RESOURCEGROUP} --query documentEndpoint -o tsv) && \ + ISTO_VERSION=$$(az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \ + DB_URL=$$(az cosmosdb show -n ${DB_NAME} -g ${RESOURCEGROUP} --query documentEndpoint -o tsv) && \ kubectl create namespace aro-hcp --dry-run=client -o json | kubectl apply -f - && \ kubectl label namespace aro-hcp "istio.io/rev=$${ISTO_VERSION}" --overwrite=true && \ helm upgrade --install aro-hcp-frontend-dev \ @@ -47,11 +49,11 @@ deploy: --set configMap.location=${LOCATION} \ --set deployment.imageName=${ARO_HCP_FRONTEND_IMAGE} \ --namespace aro-hcp +.PHONY: deploy undeploy: helm uninstall aro-hcp-frontend-dev --namespace aro-hcp +.PHONY: undeploy smoke-tests: go test -v -count 1 ./utils/frontend_smoke_test.go - -.PHONY: frontend clean image deploy undeploy diff --git a/frontend/config.tmpl.mk b/frontend/config.tmpl.mk deleted file mode 100644 index 9c0833c7f..000000000 --- a/frontend/config.tmpl.mk +++ /dev/null @@ -1,5 +0,0 @@ -ARO_HCP_IMAGE_ACR ?= {{ .svcAcrName }} -LOCATION ?= {{ .region }} -RESOURCEGROUP ?= {{ .svc.rg }} -AKS_NAME ?= {{ .aksName }} -DB_NAME ?= {{ .frontend.cosmosDB.name }} diff --git a/frontend/pipeline.yaml b/frontend/pipeline.yaml index 0a1f4df20..f3474db0c 100644 --- a/frontend/pipeline.yaml +++ b/frontend/pipeline.yaml @@ -1,8 +1,8 @@ serviceGroup: Microsoft.Azure.ARO.Test rolloutName: RP - Frontend resourceGroups: -- name: {{ .serviceClusterRG }} - subscription: {{ .serviceClusterSubscription }} +- name: {{ .svc.rg }} + subscription: {{ .svc.subscription }} aksCluster: {{ .aksName }} steps: - name: deploy @@ -14,8 +14,8 @@ resourceGroups: - name: LOCATION configRef: region - name: RESOURCEGROUP - configRef: serviceClusterRG + configRef: svc.rg - name: AKS_NAME configRef: aksName - name: DB_NAME - configRef: frontendCosmosDBName + configRef: frontend.cosmosDB.name diff --git a/tooling/templatize/pkg/config/types.go b/tooling/templatize/pkg/config/types.go index 67bf538c5..00b4fec67 100644 --- a/tooling/templatize/pkg/config/types.go +++ b/tooling/templatize/pkg/config/types.go @@ -12,9 +12,9 @@ type configProviderImpl struct { type Variables map[string]any -func (v Variables) GetByPath(path string) (interface{}, bool) { +func (v Variables) GetByPath(path string) (any, bool) { keys := strings.Split(path, ".") - var current interface{} = v + var current any = v for _, key := range keys { if m, ok := current.(Variables); ok { diff --git a/tooling/templatize/pkg/pipeline/executiontarget.go b/tooling/templatize/pkg/pipeline/executiontarget.go index f5178b73b..a74ffac06 100644 --- a/tooling/templatize/pkg/pipeline/executiontarget.go +++ b/tooling/templatize/pkg/pipeline/executiontarget.go @@ -67,13 +67,6 @@ func (target *ExecutionTarget) KubeConfig(ctx context.Context) (string, error) { return kubeconfigPath, nil } -func (target *ExecutionTarget) description() string { - if target.AKSClusterName == "" { - return fmt.Sprintf("Subscription:\t %s\n\t Resourcegroup:\t %s\n", target.SubscriptionName, target.ResourceGroup) - } - return fmt.Sprintf("SUB %s / RG %s / AKS %s", target.SubscriptionName, target.ResourceGroup, target.AKSClusterName) -} - func (target *ExecutionTarget) aksID() string { return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s", target.SubscriptionID, target.ResourceGroup, target.AKSClusterName) }