Skip to content

YAML label "yes" parsed as boolean by UI, causes resource creation to fail #881

@Gunjpz

Description

@Gunjpz

Describe the bug

  • When creating a ConfigMap with a label value "yes" (as a string), FreeLens shows an error: "json: cannot unmarshal bool into Go struct field ObjectMeta.metadata.labels of type string"
  • Even though the label is quoted ("yes"), it is being interpreted as a boolean, which is invalid for Kubernetes labels.

Reproduction steps

  1. Open ConfigMap creation in FreeLens
  2. Use the following YAML:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: configmap-test-001
      labels:
        allow-custom-indices: "yes"
    data:
      foo: bar
  3. Click "Create"
  4. See the error

Image

Expected behavior

The label value "yes" (as a string) should be accepted as a valid label value. The resource should be created without error.

Screenshots

No response

Freelens version

1.3.2

Operating system type and version

Windows 11

Installation method

EXE

Logs

No response

Kubeconfig

No response

Additional context

  • It seems the YAML parser or JSON converter is interpreting "yes" as a boolean.
  • This does not happen with "enabled" or "allowed" as the value.
  • Applying the same YAML via kubectl works fine.

Workaround
Change label value to a string like "enabled", and it works like a charm.

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