Skip to content

Commit a7d540d

Browse files
authoredJan 28, 2022
Fix RBAC Role and Service Account names in build-controller-release.sh script. (#279)
Issue #, if available: Description of changes: 6da05cd introduced a small bug in the RBAC and Service Account names generation. This patch reverts that specific change. `SERVICE` variable name is declared in line 116, hence `K8S_RBAC_ROLE_NAME` and `ACK_GENERATE_SERVICE_ACCOUNT_NAME` should be declared after. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 2eb18c5 commit a7d540d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎scripts/build-controller-release.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ ACK_GENERATE_API_VERSION=${ACK_GENERATE_API_VERSION:-"v1alpha1"}
3434
ACK_GENERATE_CONFIG_PATH=${ACK_GENERATE_CONFIG_PATH:-""}
3535
ACK_METADATA_CONFIG_PATH=${ACK_METADATA_CONFIG_PATH:-""}
3636
AWS_SDK_GO_VERSION=${AWS_SDK_GO_VERSION:-""}
37-
ACK_GENERATE_SERVICE_ACCOUNT_NAME=${ACK_GENERATE_SERVICE_ACCOUNT_NAME:-"ack-$SERVICE-controller"}
3837

3938
DEFAULT_TEMPLATES_DIR="$ROOT_DIR/../../aws-controllers-k8s/code-generator/templates"
4039
TEMPLATES_DIR=${TEMPLATES_DIR:-$DEFAULT_TEMPLATES_DIR}
@@ -43,7 +42,6 @@ DEFAULT_RUNTIME_DIR="$ROOT_DIR/../runtime"
4342
RUNTIME_DIR=${RUNTIME_DIR:-$DEFAULT_RUNTIME_DIR}
4443
RUNTIME_API_VERSION=${RUNTIME_API_VERSION:-"v1alpha1"}
4544
NON_RELEASE_VERSION="v0.0.0-non-release-version"
46-
K8S_RBAC_ROLE_NAME=${K8S_RBAC_ROLE_NAME:-"ack-$SERVICE-controller"}
4745

4846
USAGE="
4947
Usage:
@@ -82,14 +80,14 @@ Environment variables:
8280
Default: public.ecr.aws/aws-controllers-k8s/{SERVICE}-controller
8381
ACK_GENERATE_SERVICE_ACCOUNT_NAME: Name of the Kubernetes Service Account and
8482
Cluster Role to use in Helm chart.
85-
Default: $ACK_GENERATE_SERVICE_ACCOUNT_NAME
83+
Default: ack-{SERVICE}-controller
8684
AWS_SDK_GO_VERSION: Overrides the version of github.com/aws/aws-sdk-go used
8785
by 'ack-generate' to fetch the service API Specifications.
8886
Default: Version of aws/aws-sdk-go in service go.mod
8987
K8S_RBAC_ROLE_NAME: Name of the Kubernetes Role to use when
9088
generating the RBAC manifests for the
9189
custom resource definitions.
92-
Default: $K8S_RBAC_ROLE_NAME
90+
Default: ack-{SERVICE}-controller
9391
RELEASE_VERSION: SemVer version tag for the release.
9492
Default: v0.0.0-non-release-version
9593
"
@@ -122,6 +120,9 @@ SERVICE=$(echo "$1" | tr '[:upper:]' '[:lower:]')
122120
DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH="$ROOT_DIR/../$SERVICE-controller"
123121
SERVICE_CONTROLLER_SOURCE_PATH=${SERVICE_CONTROLLER_SOURCE_PATH:-$DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH}
124122

123+
K8S_RBAC_ROLE_NAME=${K8S_RBAC_ROLE_NAME:-"ack-$SERVICE-controller"}
124+
ACK_GENERATE_SERVICE_ACCOUNT_NAME=${ACK_GENERATE_SERVICE_ACCOUNT_NAME:-"ack-$SERVICE-controller"}
125+
125126
DEFAULT_IMAGE_REPOSITORY="public.ecr.aws/aws-controllers-k8s/$SERVICE-controller"
126127
ACK_GENERATE_IMAGE_REPOSITORY=${ACK_GENERATE_IMAGE_REPOSITORY:-"$DEFAULT_IMAGE_REPOSITORY"}
127128

0 commit comments

Comments
 (0)
Please sign in to comment.