use _GIT_TAG for staging repo image tag#79
Conversation
cloudbuild.yaml
Outdated
| env: | ||
| - DRIVER_IMAGE_REGISTRY=us-central1-docker.pkg.dev/k8s-staging-images/dra-example-driver | ||
| - DRIVER_IMAGE_TAG=$COMMIT_SHA | ||
| - DRIVER_IMAGE_TAG=$_GIT_TAG |
There was a problem hiding this comment.
I am unsure how expansion works in the env section. This might have been the problem with the original $COMMIT_SHA, too.
Let's do it as in https://github.com/kubernetes-csi/csi-release-tools/blob/90efb2ca59900f19eba05e65da28beda79c5bb28/cloudbuild.yaml#L32-L47 ?
There was a problem hiding this comment.
I've updated this to follow that pattern.
The docs show at least one example of substitutions of these automatic variables without an explicit mapping in substitutions. I think COMMIT_SHA was empty because Prow invokes a "manually triggered" build which doesn't seem to include that variable.
There was a problem hiding this comment.
If it can work without the substitutions, then let's try that variant first because it's simpler.
There was a problem hiding this comment.
Sounds good, changed this back.
| env: | ||
| - DRIVER_IMAGE_REGISTRY=us-central1-docker.pkg.dev/k8s-staging-images/dra-example-driver | ||
| - DRIVER_IMAGE_TAG=$COMMIT_SHA | ||
| - DRIVER_IMAGE_TAG=$_GIT_TAG # _GIT_TAG is injected by Prow |
There was a problem hiding this comment.
Nit: _GIT_TAG doesn't come from Prow, it's from the builder tool.
Magic.
Let's try it, we can always iterate further.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nojnhuh, pohly The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
$COMMIT_SHAseems to be empty as the resulting image was tagged with the defaultv0.1.0tag: https://console.cloud.google.com/artifacts/docker/k8s-staging-images/us-central1/dra-example-driver/dra-example-driver/sha256:0e8f5df34c196e5900c4d29667ce5b21ba482ef9aecc5dd19cea14fa6dde2d0c;tab=attachments?project=k8s-staging-images$_GIT_TAGis a variable injected by the Prow job that seems to be what's generally used for image tags: https://github.com/kubernetes/test-infra/blob/3e2b92318e41a47e569a90f0c71db3bcb81b9902/images/builder/README.md