Skip to content

Commit ad665fe

Browse files
authored
release script and helm bug fixes (#141)
- cluster role and role binding name mismatch - update controller image location to official public repository Tested by creating sagemaker controller By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 24d2344 commit ad665fe

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

pkg/generate/ack/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
var (
2525
releaseTemplatePaths = []string{
26+
"helm/templates/cluster-role-binding.yaml.tpl",
2627
"helm/Chart.yaml.tpl",
2728
"helm/values.yaml.tpl",
2829
"helm/templates/role-reader.yaml.tpl",
@@ -31,7 +32,6 @@ var (
3132
releaseIncludePaths = []string{}
3233
releaseCopyPaths = []string{
3334
"helm/templates/_helpers.tpl",
34-
"helm/templates/cluster-role-binding.yaml",
3535
"helm/templates/deployment.yaml",
3636
"helm/templates/metrics-service.yaml",
3737
"helm/templates/service-account.yaml",

scripts/build-controller-release.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Environment variables:
7979
Default: services/{SERVICE}
8080
ACK_GENERATE_IMAGE_REPOSITORY: Specify a Docker image repository to use
8181
for release artifacts
82-
Default: public.ecr.aws/u2r4f3v7/{SERVICE}-controller
82+
Default: public.ecr.aws/aws-controllers-k8s/{SERVICE}-controller
8383
ACK_GENERATE_SERVICE_ACCOUNT_NAME: Name of the Kubernetes Service Account and
8484
Cluster Role to use in Helm chart.
8585
Default: $ACK_GENERATE_SERVICE_ACCOUNT_NAME
@@ -121,8 +121,7 @@ SERVICE=$(echo "$1" | tr '[:upper:]' '[:lower:]')
121121
DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH="$ROOT_DIR/../$SERVICE-controller"
122122
SERVICE_CONTROLLER_SOURCE_PATH=${SERVICE_CONTROLLER_SOURCE_PATH:-$DEFAULT_SERVICE_CONTROLLER_SOURCE_PATH}
123123

124-
# TODO(vijat@): replace "u2r4f3v7" with aws-controllers-k8s
125-
DEFAULT_IMAGE_REPOSITORY="public.ecr.aws/u2r4f3v7/$SERVICE-controller"
124+
DEFAULT_IMAGE_REPOSITORY="public.ecr.aws/aws-controllers-k8s/$SERVICE-controller"
126125
ACK_GENERATE_IMAGE_REPOSITORY=${ACK_GENERATE_IMAGE_REPOSITORY:-"$DEFAULT_IMAGE_REPOSITORY"}
127126

128127
if [[ ! -d $SERVICE_CONTROLLER_SOURCE_PATH ]]; then

templates/helm/templates/cluster-role-binding.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: {{ "{{ include \"app.fullname\" . }}" }}
5+
roleRef:
6+
apiGroup: rbac.authorization.k8s.io
7+
kind: ClusterRole
8+
name: ack-{{ .ServiceIDClean }}-controller
9+
subjects:
10+
- kind: ServiceAccount
11+
name: {{ "{{ include \"service-account.name\" . }}" }}
12+
namespace: {{ "{{ .Release.Namespace }}" }}

0 commit comments

Comments
 (0)