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

charmcraft list-lib does not work without a metadata.yaml file #1973

Closed
DanielArndt opened this issue Oct 22, 2024 · 2 comments
Closed

charmcraft list-lib does not work without a metadata.yaml file #1973

DanielArndt opened this issue Oct 22, 2024 · 2 comments
Labels
Bug Something isn't working triaged

Comments

@DanielArndt
Copy link
Member

Bug Description

The command charmcraft list-lib seems to expect the charm name to be in a metadata.yaml file, but newer charms do not have this file, as everything is in charmcraft.yaml.

To Reproduce

  1. Go to a directory which contains a charm with only a charmcraft.yaml file (no metadata.yaml)
  2. Run charmcraft list-lib

Environment

Latest charmcraft (3a09483)

charmcraft.yaml

# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.

name: listlibs
type: charm
title: Charm Template
summary: A very short one-line summary of the charm.
description: |
  A single sentence that says what the charm is, concisely and memorably.

  A paragraph of one to three short sentences, that describe what the charm does.

  A third paragraph that explains what need the charm meets.

  Finally, a paragraph that describes whom the charm is useful for.
bases:
  - build-on:
    - name: ubuntu
      channel: "22.04"
    run-on:
    - name: ubuntu
      channel: "22.04"
config:
  options:
    log-level:
      description: |
        Configures the log level of gunicorn.

        Acceptable values are: "info", "debug", "warning", "error" and "critical"
      default: "info"
      type: string
containers:
  httpbin:
    resource: httpbin-image
resources:
  httpbin-image:
    type: oci-image
    description: OCI image for httpbin
    upstream-source: kennethreitz/httpbin

Relevant log output

Can't access name in 'metadata.yaml' file. The 'list-lib' command must either be executed from a valid project directory, or specify a charm name using the --charm-name option.
@DanielArndt DanielArndt added the Bug Something isn't working label Oct 22, 2024
@lengau lengau added the triaged label Nov 18, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3695.

This message was autogenerated

lengau pushed a commit that referenced this issue Nov 29, 2024
I don't know if this is the best way to solve the problem, but it's an
attempt to solve #1973

Tested locally and it seems to solve the problem.
@DanielArndt
Copy link
Member Author

Fixed by #1974

lengau pushed a commit to tmihoc/charmcraft that referenced this issue Dec 19, 2024
I don't know if this is the best way to solve the problem, but it's an
attempt to solve canonical#1973

Tested locally and it seems to solve the problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants