Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force lower case on Bazel pkg path to play nice with oci container name spec #2252

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

sfc-gh-bxin
Copy link
Contributor

@sfc-gh-bxin sfc-gh-bxin commented Apr 27, 2023

The OCI distribution spec only allows lower case letter in container repository name
(https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests), this doesn't bode well with Bazel package path using upper case.

Relevant docker spec on 'repository name' scheme: https://github.com/moby/moby/blob/master/image/spec/v1.2.md. Among other things: "...Name components may contain lowercase characters, digits, and separators...."

So force lower case on pkg path.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

<bazel_ws>/Pkg_path_with_upper_case/ $ bazel build <:container_image_target.tar>
...
FAILED: Build did NOT complete successfully
...
Unable to process values passed using the flag --tag: unable to parse stamped image name "bazel/Pkg_path_with_upper_case:container_image_target" as a fully qualified image reference: repository can only contain the runes abcdefghijklmnopqrstuvwxyz0123456789_-./: bazel/Pkg_path_with_upper_case

Issue Number: N/A

What is the new behavior?

bazel builds successfully.

Does this PR introduce a breaking change?

  • Yes
  • No. (Since this makes a previously broken build to successfully build)

Other information

…repository

name
(https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests),
this doesn't bode well with Bazel package path using upper case.

To be clear: docker itself is ok with upper case:
https://ktomk.github.io/pipelines/doc/DOCKER-NAME-TAG.html.

Picking the common denominator here, and force lower case on pkg path.
@google-cla
Copy link

google-cla bot commented Apr 27, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@linzhp linzhp merged commit 8e70c6b into bazelbuild:master Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants