Open lengau opened 2 months ago
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2878.
This message was autogenerated
While investigating this issue I also found out that the validation on the charm name in the libs, is in contradiction with what the charmhub API expects.
If I put the following in my charmcraft.yaml
charm-libs:
- lib: traefik-k8s.ingress
version: "2"
I get the following error:
- Invalid charm name in lib 'traefik-k8s.ingress'. Try replacing hyphens ('-') with underscores ('_'). (in field 'charm-libs[0].lib')
But if I use underscore instead the charmhub API doesn't recognize the charm-name
❯ curl -X POST 'https://api.charmhub.io/v1/charm/libraries/bulk' -H "Content-Type: application/json" --data '[{"charm-name": "traefik_k8s", "library-name": "ingress", "api": 2}]'
{"error-list":[{"code":null,"message":"Items need to include 'library_id' or 'package_id'"}]}
While using an hyphen:
❯ curl -X POST 'https://api.charmhub.io/v1/charm/libraries/bulk' -H "Content-Type: application/json" --data '[{"charm-name": "traefik-k8s", "library-name": "ingress", "api": 2}]'
{"libraries":[{"api":2,"charm-name":"traefik-k8s","created-at":"2024-05-02T11:09:33.567275","hash":"7410561327d3b8867651b6d664b7a5aab3a0f00aebac81a36911ec8dc11eb96d","library-id":"e6de2a5cd5b34422a204668f3b8f90d2","library-name":"ingress","patch":13}]}
Bug Description
The
fetch-libs
command uses a logged in charmhub session, though it doesn't need to.To Reproduce
charmcraft fetch-libs
Expected:
Libraries are collected
Actual:
Requests login
Environment
n/a
charmcraft.yaml
Relevant log output