Skip to content

kubectl describe incorrectly splits acronyms in CRD field names #1805

@uozalp

Description

@uozalp

What happened?

When using kubectl describe on Custom Resources with camelCase field names containing acronyms followed by a lowercase letter, the field names are incorrectly humanized with unwanted spaces. For example, a field named respectPDBs is displayed as "Respect PD Bs" instead of "Respect PDBs".

Spec:
  Respect PD Bs:  true

What did you expect to happen?

The field name respectPDBs should be displayed as Respect PDBs with the acronym kept together, not split into separate parts.

How can we reproduce it (as minimally and precisely as possible)?

test-patchplan-instance.yaml

apiVersion: example.com/v1
kind: PatchPlan
metadata:
  name: test-patchplan
spec:
  respectPDBs: true

test-pdb-crd.yaml

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: patchplans.example.com
spec:
  group: example.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                respectPDBs:
                  type: boolean
                  description: Whether to respect Pod Disruption Budgets
      additionalPrinterColumns:
        - name: Respect PDBs
          type: boolean
          jsonPath: .spec.respectPDBs
  scope: Namespaced
  names:
    plural: patchplans
    singular: patchplan
    kind: PatchPlan
kubectl apply -f test-pdb-crd.yaml
kubectl apply -f test-patchplan-instance.yaml
kubectl describe patchplan test-patchplan | grep Respect

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-sigIndicates an issue or PR lacks a `sig/foo` label and requires one.priority/backlogHigher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions