grafeas / voucher

🎟 Voucher creates attestations for Binary Authorization
Apache License 2.0
73 stars 24 forks source link

ReferenceToProject: support Artifact Registry #63

Closed thepwagner closed 2 years ago

thepwagner commented 2 years ago

Voucher parses registry URLs to map Google Container Registry URLs to the owning GCP project. This informs the project that is queried for build metadata about the image. The Google Artifact Registry changes the URL syntax for images hosted in GCP projects.

This PR updates ReferenceToProject to detect projects from the Google Artifact Registry format URLs. Since the number of test cases grew to >= 3, I refactored to using a table-driven test.

Related

thepwagner commented 2 years ago

The second commit is what @rxbchen reviewed just pasted to a different part of the code; I'm not going to request re-review for that.