# See https://cloud.google.com/cloud-build/docs/build-config
options:
  substitution_option: ALLOW_LOOSE
  machineType: 'N1_HIGHCPU_8'
steps:
  - name: gcr.io/k8s-testimages/gcb-docker-gcloud
    entrypoint: /buildx-entrypoint
    args:
    - build
    - --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:$_GIT_TAG
    - --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:latest
    - --build-arg=VERSION=$_GIT_TAG
    - --output=type=registry
    - --platform=linux/amd64,linux/arm64
    - .
substitutions:
  _GIT_TAG: '12345'
timeout: 1200s

# See https://cloud.google.com/cloud-build/docs/build-config
options:
  substitution_option: ALLOW_LOOSE
  machineType: 'N1_HIGHCPU_8'
steps:
  - name: gcr.io/k8s-testimages/gcb-docker-gcloud
    entrypoint: /buildx-entrypoint
    args:
    - build
    - --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:$_GIT_TAG
    - --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:latest
    - --build-arg=VERSION=$(echo $_GIT_TAG | awk -F - '{print $2}')
    - --output=type=registry
    - --platform=linux/amd64,linux/arm64
    - .
substitutions:
  _GIT_TAG: '12345'
timeout: 1200s

Trim date prefix from tag in GCB image build
Trim date prefix from tag in GCB image build

The image pushing setup in test-infra defines _GIT_TAG with a vYYYYMMDD prefix to `git describe`.
This format isn't allowed by k8s.io/component-base panicing on startup.

By trimming the date prefix from the tag, image builds will only contain the `git describe` output, matching the binaries built from the Makefile
