jlewi / hydros

hydros automates hydrating and committing configuration
Apache License 2.0
4 stars 0 forks source link

Google Artifact Registry support - matching images #10

Open jlewi opened 1 year ago

jlewi commented 1 year ago

Support finding the latest images in GCR (right now ECR is supported)

jlewi commented 1 year ago

So I think one function that needs to change is resolveImageToSha https://github.com/jlewi/hydros/blob/6650d2508b24cf14cc49723059023fa9e1c99ffd/pkg/gitops/syncer.go#L945

That is currently using ECR APIs / client libraries to resolve an image tag to a sha. We should be able to use crane libraries for this. e.g the crane CLI does this as follows.

gcrane digest us-west1-docker.pkg.dev/chat-lewi/autobuilder/agent:latest
jlewi commented 10 months ago

I think it should be straightforward to support the source commit strategy. Since that strategy resolves images by tag. I think we just need to update this if statement to support tag strategy https://github.com/jlewi/hydros/blob/3933b1d7e3d02dd77976c5f8a0244ef7a68a0590/pkg/gcp/artifactregistry.go#L79