Skip to content

Commit 76b5668

Browse files
committed
gcp/bash: fix various typos for ensure-prod-storage.sh
Fix role name format Fix incorrect region name Fix indentation Signed-off-by: Arnaud Meukam <[email protected]>
1 parent 528e65e commit 76b5668

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

infra/gcp/bash/ensure-prod-storage.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ readonly PROD_PROJECT_DISABLED_SERVICES=(
9191
# Regions for prod GCR.
9292
GCR_PROD_REGIONS=(us eu asia)
9393
# Regions for prod AR.
94-
AR_PROD_REGIONS=(asia-east1 asia-south1 asia-northeast1 asia-northeast2 australia-southeast1 europe-north1 europe-southeast1 europe-west1 europe-west2 europe-west4 europe-west8 europe-west9 southamerica-west1 us-central1 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2)
94+
AR_PROD_REGIONS=(asia-east1 asia-south1 asia-northeast1 asia-northeast2 australia-southeast1 europe-north1 europe-southwest1 europe-west1 europe-west2 europe-west4 europe-west8 europe-west9 southamerica-west1 us-central1 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2)
9595

9696
# Minimum time we expect to keep prod GCS artifacts.
9797
PROD_RETENTION="10y"
@@ -116,7 +116,7 @@ function ensure_prod_gcr() {
116116

117117
color 6 "Ensuring GCR admins can admin GCR in region: ${region} for project: ${project}"
118118
empower_gcr_admins "${project}" "${region}"
119-
119+
120120
color 6 "Empowering image promoter for region: ${region} in project: ${project}"
121121
empower_image_promoter "${project}" "${region}"
122122

@@ -145,10 +145,10 @@ function ensure_prod_ar() {
145145

146146
color 6 "Ensuring GCR admins can admin AR in location: ${region} for project: ${project}"
147147
empower_ar_admins "${project}" "${region}"
148-
148+
149149
color 6 "Empowering image promoter with roles/artifactregistry.repoAdmin in project: ${project}"
150150
serviceaccount=$(svc_acct_email "${project}" "${IMAGE_PROMOTER_SVCACCT}")
151-
ensure_project_role_binding "${project}" "serviceAccount:$serviceaccount" "artifactregistry.repoAdmin"
151+
ensure_project_role_binding "${project}" "serviceAccount:$serviceaccount" "roles/artifactregistry.repoAdmin"
152152
done 2>&1 | indent
153153
}
154154

@@ -399,7 +399,7 @@ function ensure_all_prod_special_cases() {
399399
color 6 "Ensuring GKE clusters in '${project}' can run pods in '${PROWJOB_POD_NAMESPACE}' as '${serviceaccount}'"
400400
empower_gke_for_serviceaccount \
401401
"${project}" "${PROWJOB_POD_NAMESPACE}" \
402-
"${serviceaccount}" "k8s-infra-gcr-vuln-scanning"
402+
"${serviceaccount}" "k8s-infra-gcr-vuln-scanning"
403403
done
404404

405405
# For write access to:

infra/gcp/bash/lib_ar.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function empower_group_to_write_ar() {
3434
local project="$2"
3535
local location="$3"
3636

37-
ensure_repository_role_binding "images" "${group}" "artifactregistry.repoAdmin" "${project}" "${location}"
37+
ensure_ar_repository_role_binding "images" "${group}" "roles/artifactregistry.repoAdmin" "${project}" "${location}"
3838
}
3939

4040
function ensure_public_ar_registry() {
@@ -45,7 +45,7 @@ function ensure_public_ar_registry() {
4545
local project="$1"
4646
local location="$2"
4747

48-
ensure_repository_role_binding "images" "allUsers" "artifactregistry.reader" "${project}" "${location}"
48+
ensure_ar_repository_role_binding "images" "allUsers" "roles/artifactregistry.reader" "${project}" "${location}"
4949
}
5050

5151
function empower_ar_admins() {
@@ -57,7 +57,7 @@ function empower_ar_admins() {
5757
local project="$1"
5858
local location="$2"
5959

60-
ensure_repository_role_binding "images" "group:${GCR_ADMINS}" "artifactregistry.admin" "${project}" "${location}"
60+
ensure_ar_repository_role_binding "images" "group:${GCR_ADMINS}" "roles/artifactregistry.admin" "${project}" "${location}"
6161
}
6262

6363
# Ensure the AR registry exists and is world-readable.

0 commit comments

Comments
 (0)