Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prod projects for GCR backups #376

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions infra/gcp/ensure-prod-storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,31 @@ function empower_group_to_fake_prod() {
done
}

#
# The GCP project names.
#

# This is the "real" prod project for artifacts serving and backups.
PROD_PROJECT="k8s-artifacts-prod"
PROMOTER_TESTPROD_PROJECT="k8s-cip-test-prod"
PROMOTER_STAGING_PROJECT="k8s-staging-cip-test"
PRODBAK_PROJECT="${PROD_PROJECT}-bak"

# These are for testing the image promoter's promotion process.
PROMOTER_TEST_PROD_PROJECT="k8s-cip-test-prod"
PROMOTER_TEST_STAGING_PROJECT="k8s-staging-cip-test"

# These are for testing the GCR backup/restore process.
GCR_BACKUP_TEST_PROD_PROJECT="k8s-gcr-backup-test-prod"
GCR_BACKUP_TEST_PRODBAK_PROJECT="${ARTIFACT_BACKUP_TEST_PROD_PROJECT}-bak"

# This is for testing the release tools.
RELEASE_TESTPROD_PROJECT="k8s-release-test-prod"

ALL_PROD_PROJECTS=(
"${PROD_PROJECT}"
"${PROMOTER_TESTPROD_PROJECT}"
"${PRODBAK_PROJECT}"
"${PROMOTER_TEST_PROD_PROJECT}"
"${GCR_BACKUP_TEST_PROD_PROJECT}"
"${GCR_BACKUP_TEST_PRODBAK_PROJECT}"
"${RELEASE_TESTPROD_PROJECT}"
)

Expand Down Expand Up @@ -124,16 +140,22 @@ upload_gcs_static_content \
"${SCRIPT_DIR}/static/prod-storage"

# Special case: grant the image promoter testing group access to their fake
# prod project.
# prod projects.
empower_group_to_fake_prod \
"${PROMOTER_TEST_PROD_PROJECT}" \
"k8s-infra-staging-cip-test@kubernetes.io"
empower_group_to_fake_prod \
"${GCR_BACKUP_TEST_PROD_PROJECT}" \
"k8s-infra-staging-cip-test@kubernetes.io"
empower_group_to_fake_prod \
"${PROMOTER_TESTPROD_PROJECT}" \
"${GCR_BACKUP_TEST_PRODBAK_PROJECT}" \
"k8s-infra-staging-cip-test@kubernetes.io"

# Special case: grant the image promoter service account access to their
# staging, to allow e2e tests to run as that account, instead of yet a another.
# Special case: grant the image promoter test service account access to their
# staging, to allow e2e tests to run as that account, instead of yet another.
empower_service_account_to_artifacts \
$(svc_acct_email "${PROMOTER_TESTPROD_PROJECT}" "${PROMOTER_SVCACCT}") \
"${PROMOTER_STAGING_PROJECT}"
$(svc_acct_email "${PROMOTER_TEST_PROD_PROJECT}" "${PROMOTER_SVCACCT}") \
"${PROMOTER_TEST_STAGING_PROJECT}"

# Special case: grant the release tools testing group access to their fake
# prod project.
Expand Down