bazel-contrib / rules_oci

Bazel rules for building OCI containers
Apache License 2.0
287 stars 151 forks source link

Allow configuring registry_patterns in `oci_pull` #683

Open sfc-gh-mhazy opened 1 month ago

sfc-gh-mhazy commented 1 month ago

Currently registry patterns are hardcoded here: https://github.com/bazel-contrib/rules_oci/blob/9faf21099d83f5250d586f1f62540ac439580118/oci/private/authn.bzl#L9

If one uses private registry, they can either add their pattern to this list (app.snowflake.com as an example), or apply patches in their workspaces.

I think the more flexible solution could be to allow passing the registry patterns in oci_pull.

I'm happy to add the change if you agree.

shs96c commented 1 month ago

Applying patches in a world where we rely on bzlmod isn't going to be appropriate or possible in all cases. Having a mechanism to add additional registry patterns that doesn't require us to patch rules_oci would be most useful.

thesayyn commented 1 month ago

I strongly agree with you both, there is https://github.com/bazel-contrib/rules_oci/issues/126.

I don't have the time to implement it myself, but if anybody is willing to put up a PR with some tests.