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

Cannot release repository with build metadata #1409

Open
mamachanko opened this issue Nov 17, 2023 · 2 comments
Open

Cannot release repository with build metadata #1409

mamachanko opened this issue Nov 17, 2023 · 2 comments
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@mamachanko
Copy link
Contributor

What steps did you take:

I tried to release a package repository with build metadata:

kctrl package repository release --version 2.6.0-0+git.a65d891.dirty.user.mbrauer --yes --chdir build

What happened:

kctrl error'd with:

kctrl: Error: imgpkg:
  Error:
    Parsing ':2.6.0-0+git.a65d891.dirty.user.mbrauer': tag can only contain the characters `abcdefghijklmnopqrstuvwxyz0123456789_-.ABCDEFGHIJKLMNOPQRSTUVWXYZ`: 2.6.0-0+git.a65d891.dirty.user.mbrauer

In detail:

❯ make repository
kctrl package repository release --version 2.6.0-0+git.a65d891.dirty.user.mbrauer --yes --chdir build

Prerequisites
1. `packages` directory containing Package and PackageMetadata files present in
the working directory.
2. Host is authorized to push images to a registry (can be set up using `docker
login`)

Basic Information
Registry URL
The bundle created needs to be pushed to an OCI registry (format:
<REGISTRY_URL/REPOSITORY_NAME>) e.g. index.docker.io/k8slt/sample-bundlekbld ensures that all image references are resolved to an immutable reference.
Lock image references using kbld
            | $ kbld -f packages --imgpkg-lock-output .imgpkg/images.yml

An imgpkg bundle consists of all required YAML configuration bundled into an OCI
image that can be pushed to an image registry and consumed by the package.
Pushing imgpkg bundle
            | $ imgpkg push -b :2.6.0-0+git.a65d891.dirty.user.mbrauer -f ./bundle-:2.6.0-0+git.a65d891.dirty.user.mbrauer-3288778765 --tty=true

kctrl: Error: imgpkg:
  Error:
    Parsing ':2.6.0-0+git.a65d891.dirty.user.mbrauer': tag can only contain the characters `abcdefghijklmnopqrstuvwxyz0123456789_-.ABCDEFGHIJKLMNOPQRSTUVWXYZ`: 2.6.0-0+git.a65d891.dirty.user.mbrauer

What did you expect:

As per semver#10 a version can have build metadata which is delimited with a +. I would expect that --version can receive any valid semver. Unfortunately, an OCI image tag cannot contain a + character. I am aware that presents a challenge, but I would expect that a user of kctrl package (repository) release need not be concerned with that issue.

Anything else you would like to add:

Maybe kctrl could map + to _ under the hood and reverse the mapping when inferring a version from a tag. In my case:

  • version: 2.6.0-0+git.a65d891.dirty.user.mbrauer
  • tag: 2.6.0-0_git.a65d891.dirty.user.mbrauer

Environment:

❯ kctrl -v
kctrl version 0.48.2

Succeeded

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@mamachanko mamachanko added bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Nov 17, 2023
Copy link

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

@github-actions github-actions bot added the stale This issue has had no activity for a while and will be closed soon label Dec 28, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@github-project-automation github-project-automation bot moved this to Closed in Carvel Jan 2, 2024
@renuy renuy added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed stale This issue has had no activity for a while and will be closed soon carvel-triage This issue has not yet been reviewed for validity labels Jan 2, 2024
@renuy renuy moved this from Closed to Prioritized Backlog in Carvel Jan 2, 2024
@renuy renuy reopened this Jan 2, 2024
@github-project-automation github-project-automation bot moved this from Prioritized Backlog to In Progress in Carvel Jan 2, 2024
@renuy renuy moved this from In Progress to Prioritized Backlog in Carvel Jan 2, 2024
@github-actions github-actions bot added the carvel-triage This issue has not yet been reviewed for validity label Jan 2, 2024
@renuy renuy added carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. and removed carvel-accepted This issue should be considered for future work and that the triage process has been completed carvel-triage This issue has not yet been reviewed for validity labels Jan 2, 2024
@praveenrewar
Copy link
Member

I would expect that --version can receive any valid semver. Unfortunately, an OCI image tag cannot contain a + character.

💯
We need to think of a long term approach for this. I do like the idea of translating the + into something else under the hood, we need to ensure that the change is also backward compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
Status: Prioritized Backlog
Development

No branches or pull requests

3 participants