Skip to content

Commit

Permalink
Remove the need to specify GCP project for image uploads
Browse files Browse the repository at this point in the history
We can infer the project from the secret credentials so let's do that.
One less moving piece.
  • Loading branch information
dustymabe committed Apr 7, 2020
1 parent 5c6f1d6 commit 9d22e9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ node {
s3_bucket = utils.get_pipeline_annotation('s3-bucket')
kvm_selector = utils.get_pipeline_annotation('kvm-selector')
gcp_gs_bucket = utils.get_pipeline_annotation('gcp-gs-bucket')
gcp_project = utils.get_pipeline_annotation('gcp-project')

// sanity check that a valid prefix is provided if in devel mode and drop
// the trailing '-' in the devel prefix
Expand Down Expand Up @@ -423,11 +422,13 @@ lock(resource: "build-${params.STREAM}") {
if (utils.path_exists("\${GCP_IMAGE_UPLOAD_CONFIG}")) {
stage('Upload GCP') {
utils.shwrap("""
# pick up the project to use from the config
gcp_project=\$(jq -r .project_id \${GCP_IMAGE_UPLOAD_CONFIG})
cosa buildextend-gcp \
--build=${newBuildID} \
--upload \
--family fedora-coreos-${params.STREAM} \
--project=${gcp_project} \
--project=\${gcp_project} \
--bucket gs://${gcp_gs_bucket}/image-import \
--json \${GCP_IMAGE_UPLOAD_CONFIG}
""")
Expand Down
4 changes: 0 additions & 4 deletions deploy
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def parse_args():
help="Repo and ref to use for FCOS config")
parser.add_argument("--bucket", metavar='BUCKET',
help="AWS S3 bucket to use")
parser.add_argument("--gcp-project", metavar='GCP_PROJECT',
help="GCP project to use for image uploads")
parser.add_argument("--gcp-gs-bucket", metavar='GCP_GS_BUCKET',
help="GCP GS bucket to use for image uploads during import")
parser.add_argument("--kvm-selector", help="KVM selector",
Expand Down Expand Up @@ -152,8 +150,6 @@ def process_template(args):
params['PVC_SIZE'] = args.pvc_size
if args.kvm_selector:
params['KVM_SELECTOR'] = args.kvm_selector
if args.gcp_project:
params['GCP_PROJECT'] = args.gcp_project
if args.gcp_gs_bucket:
params['GCP_GS_BUCKET'] = args.gcp_gs_bucket

Expand Down
4 changes: 0 additions & 4 deletions manifests/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ parameters:
- description: Whether to use KVM device plugin or legacy OCI KVM hook
name: KVM_SELECTOR
value: legacy-oci-kvm-hook
- description: GCP Project to use for image creation
name: GCP_PROJECT
value: fedora-coreos-cloud
- description: GCP GS bucket to use for image uploads (or blank for none)
name: GCP_GS_BUCKET
value: fedora-coreos-cloud-image-uploads
Expand Down Expand Up @@ -109,7 +106,6 @@ objects:
coreos.com/developer-prefix: ${DEVELOPER_PREFIX}
coreos.com/s3-bucket: ${S3_BUCKET}
coreos.com/kvm-selector: ${KVM_SELECTOR}
coreos.com/gcp-project: ${GCP_PROJECT}
coreos.com/gcp-gs-bucket: ${GCP_GS_BUCKET}
spec:
# note no triggers: the base pipeline is only ever triggered manually, or
Expand Down

0 comments on commit 9d22e9e

Please sign in to comment.