Skip to content

crane: allow empty label values #2376

Description

@elmuerte

Describe the bug

An empty label value is not accepted by the mutate command. But labels without values are allowed according to the spec.

https://github.com/opencontainers/image-spec/blob/main/annotations.md#rules

While the value MUST be present, it MAY be an empty string.

To Reproduce

crane mutate --label my.key= my-image:tag

produces the error

Error: parsing label "my.key", value is empty

Expected behavior

I expect the image to be modified with a label set with a empty string as value.

Additional context

Crane version e8813dd

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions