From 5ad792fb4c67c69378bc82700fd2ceb37beb67f1 Mon Sep 17 00:00:00 2001 From: Suraj Kota Date: Fri, 30 Jul 2021 01:22:35 +0000 Subject: [PATCH] release bug fixes --- pkg/generate/ack/release.go | 2 +- scripts/build-controller-release.sh | 5 ++--- templates/helm/templates/cluster-role-binding.yaml | 12 ------------ .../helm/templates/cluster-role-binding.yaml.tpl | 12 ++++++++++++ 4 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 templates/helm/templates/cluster-role-binding.yaml create mode 100644 templates/helm/templates/cluster-role-binding.yaml.tpl diff --git a/pkg/generate/ack/release.go b/pkg/generate/ack/release.go index 34ea0606..f1fe6e49 100644 --- a/pkg/generate/ack/release.go +++ b/pkg/generate/ack/release.go @@ -23,6 +23,7 @@ import ( var ( releaseTemplatePaths = []string{ + "helm/templates/cluster-role-binding.yaml.tpl", "helm/Chart.yaml.tpl", "helm/values.yaml.tpl", "helm/templates/role-reader.yaml.tpl", @@ -31,7 +32,6 @@ var ( releaseIncludePaths = []string{} releaseCopyPaths = []string{ "helm/templates/_helpers.tpl", - "helm/templates/cluster-role-binding.yaml", "helm/templates/deployment.yaml", "helm/templates/metrics-service.yaml", "helm/templates/service-account.yaml", diff --git a/scripts/build-controller-release.sh b/scripts/build-controller-release.sh index 9d28e9da..f1f93d06 100755 --- a/scripts/build-controller-release.sh +++ b/scripts/build-controller-release.sh @@ -79,7 +79,7 @@ Environment variables: Default: services/{SERVICE} ACK_GENERATE_IMAGE_REPOSITORY: Specify a Docker image repository to use for release artifacts - Default: public.ecr.aws/u2r4f3v7/{SERVICE}-controller + Default: public.ecr.aws/aws-controllers-k8s/{SERVICE}-controller ACK_GENERATE_SERVICE_ACCOUNT_NAME: Name of the Kubernetes Service Account and Cluster Role to use in Helm chart. Default: $ACK_GENERATE_SERVICE_ACCOUNT_NAME @@ -121,8 +121,7 @@ SERVICE=$(echo "$1" | tr '[:upper:]' '[:lower:]') DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH="$ROOT_DIR/../$SERVICE-controller" SERVICE_CONTROLLER_SOURCE_PATH=${SERVICE_CONTROLLER_SOURCE_PATH:-$DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH} -# TODO(vijat@): replace "u2r4f3v7" with aws-controllers-k8s -DEFAULT_IMAGE_REPOSITORY="public.ecr.aws/u2r4f3v7/$SERVICE-controller" +DEFAULT_IMAGE_REPOSITORY="public.ecr.aws/aws-controllers-k8s/$SERVICE-controller" ACK_GENERATE_IMAGE_REPOSITORY=${ACK_GENERATE_IMAGE_REPOSITORY:-"$DEFAULT_IMAGE_REPOSITORY"} if [[ ! -d $SERVICE_CONTROLLER_SOURCE_PATH ]]; then diff --git a/templates/helm/templates/cluster-role-binding.yaml b/templates/helm/templates/cluster-role-binding.yaml deleted file mode 100644 index ff84bc87..00000000 --- a/templates/helm/templates/cluster-role-binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ include "app.fullname" . }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ include "app.name" . }} -subjects: -- kind: ServiceAccount - name: {{ include "service-account.name" . }} - namespace: {{ .Release.Namespace }} diff --git a/templates/helm/templates/cluster-role-binding.yaml.tpl b/templates/helm/templates/cluster-role-binding.yaml.tpl new file mode 100644 index 00000000..7217db39 --- /dev/null +++ b/templates/helm/templates/cluster-role-binding.yaml.tpl @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ "{{ include \"app.fullname\" . }}" }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ack-{{ .ServiceIDClean }}-controller +subjects: +- kind: ServiceAccount + name: {{ "{{ include \"service-account.name\" . }}" }} + namespace: {{ "{{ .Release.Namespace }}" }}