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 install package with prerelease identifier containing x #1518

Closed
mamachanko opened this issue Mar 28, 2024 · 3 comments
Closed

Cannot install package with prerelease identifier containing x #1518

mamachanko opened this issue Mar 28, 2024 · 3 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

Comments

@mamachanko
Copy link
Contributor

mamachanko commented Mar 28, 2024

What steps did you take:

Install a package with prerelease identifier containing x, say test.example.com/0.1.0-experimental.

#! test.yaml

---
apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata: 
  name: test.example.com.0.1.0-experimental
  namespace: tap-cert-manager-install
spec: 
  refName: test.example.com
  version: 0.1.0-experimental
  template: 
    spec: 
      deploy: 
        - kapp: {}
      fetch: 
        - path: config
          inline: 
            paths: 
              config/config.yaml: |
                ---
                apiVersion: v1
                kind: ConfigMap
                metadata: 
                  name: test.example.com
                data: 
                  message: hello
      template: 
        - ytt: 
            paths: 
              - ./config

---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata: 
  name: test
  namespace: tap-cert-manager-install
spec: 
  packageRef: 
    refName: test.example.com
    versionSelection: 
      constraints: 0.1.0-experimental
  serviceAccountName: install-sa
ytt -f test.yaml | 'kapp d -y -c -f- --logs-all -a p

What happened:

Target cluster 'https://127.0.0.1:54217' (nodes: kind-cert-manager-control-plane)

@@ create package/test.example.com.0.1.0-experimental (data.packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install @@
      0 + apiVersion: data.packaging.carvel.dev/v1alpha1
      1 + kind: Package
      2 + metadata:
      3 +   labels:
      4 +     kapp.k14s.io/app: "1711611146051431000"
      5 +     kapp.k14s.io/association: v1.0309736a6eed43720870e0e31bc67fee
      6 +   name: test.example.com.0.1.0-experimental
      7 +   namespace: tap-cert-manager-install
      8 + spec:
      9 +   refName: test.example.com
     10 +   template:
     11 +     spec:
     12 +       deploy:
     13 +       - kapp: {}
     14 +       fetch:
     15 +       - inline:
     16 +           paths:
     17 +             config/config.yaml: "---\napiVersion: v1\nkind: ConfigMap\nmetadata: \n
     18 +               \ name: test.example.com\ndata: \n  message: hello\n"
     19 +         path: config
     20 +       template:
     21 +       - ytt:
     22 +           paths:
     23 +           - ./config
     24 +   version: 0.1.0-experimental
     25 +
@@ create packageinstall/test (packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install @@
      0 + apiVersion: packaging.carvel.dev/v1alpha1
      1 + kind: PackageInstall
      2 + metadata:
      3 +   labels:
      4 +     kapp.k14s.io/app: "1711611146051431000"
      5 +     kapp.k14s.io/association: v1.f8f960ff3ce5fa32671be1cf7e4aebaf
      6 +   name: test
      7 +   namespace: tap-cert-manager-install
      8 + spec:
      9 +   packageRef:
     10 +     refName: test.example.com
     11 +     versionSelection:
     12 +       constraints: 0.1.0-experimental
     13 +   serviceAccountName: install-sa
     14 +

Changes

Namespace                 Name                                 Kind            Age  Op      Op st.  Wait to    Rs  Ri
tap-cert-manager-install  test                                 PackageInstall  -    create  -       reconcile  -   -
^                         test.example.com.0.1.0-experimental  Package         -    create  -       reconcile  -   -

Op:      2 create, 0 delete, 0 update, 0 noop, 0 exists
Wait to: 2 reconcile, 0 delete, 0 noop

8:32:26AM: ---- applying 2 changes [0/2 done] ----
8:32:26AM: create packageinstall/test (packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install
8:32:26AM: create package/test.example.com.0.1.0-experimental (data.packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install
8:32:26AM: ---- waiting on 2 changes [0/2 done] ----
8:32:26AM: ongoing: reconcile packageinstall/test (packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install
8:32:26AM:  ^ Waiting for generation 1 to be observed
8:32:26AM: ok: reconcile package/test.example.com.0.1.0-experimental (data.packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install
8:32:26AM: ---- waiting on 1 changes [1/2 done] ----
8:32:26AM: fail: reconcile packageinstall/test (packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install
8:32:26AM:  ^ Reconcile failed:  (message: Selecting versions: Parsing version constraint '0.1.0-experimental': Could not get version from string: "<")

kapp: Error: waiting on reconcile packageinstall/test (packaging.carvel.dev/v1alpha1) namespace: tap-cert-manager-install:
  Finished unsuccessfully (Reconcile failed:  (message: Selecting versions: Parsing version constraint '0.1.0-experimental': Could not get version from string: "<"))

The present x trips carvel-dev/semver into applying wildcard logic. But it's not a wildcard. There are no wildcards in prerelease identifiers.

What did you expect:

It install the package.

Anything else you would like to add:

The issue originates in github.com/carvel-dev/semver and gets exposed to kapp-controller through github.com/carvel-dev/vendir. There is the existing carvel-dev/vendir#123 which is now ~3 years old. Therefore I am bringing it up here again.

The problem is that the issue goes down so deep and the error message Parsing version constraint '0.1.0-experimental': Could not get version from string: "<" is incomprehensible unless one knows what's going on.

[Additional information that will assist in solving the issue.]

Environment:

  • kapp Controller version v0.48.2

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 Mar 28, 2024
@mamachanko
Copy link
Contributor Author

I am now versioning that package with eggsperimental because I am upset and Easter is approaching 😆

@praveenrewar praveenrewar added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed carvel-triage This issue has not yet been reviewed for validity labels Mar 28, 2024
@praveenrewar
Copy link
Member

I am now versioning that package with eggsperimental because I am upset and Easter is approaching 😆

🤣

As always, thank you so much for being amazing and looking into this ❤️

mamachanko added a commit to mamachanko/kapp-controller that referenced this issue Apr 17, 2024
mamachanko added a commit to mamachanko/kapp-controller that referenced this issue Apr 17, 2024
This was referenced Apr 17, 2024
@mamachanko
Copy link
Contributor Author

supposed to be fixed by #1534

@mamachanko mamachanko reopened this Apr 18, 2024
@github-project-automation github-project-automation bot moved this to Closed in Carvel Apr 18, 2024
@github-project-automation github-project-automation bot moved this from Closed to In Progress in Carvel Apr 18, 2024
@github-actions github-actions bot added carvel-triage This issue has not yet been reviewed for validity and removed carvel-triage This issue has not yet been reviewed for validity labels Apr 18, 2024
@renuy renuy removed the carvel-triage This issue has not yet been reviewed for validity label Apr 19, 2024
@renuy renuy closed this as completed Apr 19, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Closed in Carvel Apr 19, 2024
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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants