GoogleCloudPlatform / cloud-builders-community

Community-contributed images for Google Cloud Build
https://cloud.google.com/cloud-build/
Apache License 2.0
1.26k stars 858 forks source link

Fix `binauthz-attestation` scripts `gcloud` flags #563

Closed KeisukeYamashita closed 1 year ago

KeisukeYamashita commented 2 years ago

WHY

When I created a step as below:

  - name: asia-northeast1-docker.pkg.dev/${PROJECT_ID}/tools/binauthz-attestation
    args:
      - --artifact-url
      - asia-northeast1-docker.pkg.dev/$PROJECT_ID/src/my-image:$_TAG
      - --attestor
      - projects/$PROJECT_ID/attestors/cloud-build-signer
      - --keyversion
      - projects/$PROJECT_ID/locations/asia-northeast1/keyRings/container_analysis/cryptoKeys/attestation_02/cryptoKeyVersions/1

I got this error message

Step #1: ERROR: (gcloud.beta.container.binauthz.attestations.sign-and-create) unrecognized arguments: "--artifact-url=$IMAGE_AND_DIGEST" (did you mean '--artifact-url'?) 

This is the fixture for it. I tested with this and worked 👍