derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.95k stars 1.69k forks source link

CRDs listed in red but don't seem to be deprecated #2836

Open ybizeul opened 2 months ago

ybizeul commented 2 months ago




Describe the bug Some CRDs appear in red, but not sure what the reason is. They contain some deprecated versions of their schema, which is pretty standard, but their most recent schema is not deprecated and should be displayed as such it seems

To Reproduce In my case, I was deploying a kubernetes cluster with CAPI, most controller resource appear red

Historical Documents This is an example resource that shows in red

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
[...]
  name: machines.cluster.x-k8s.io
spec:
  conversion:
    strategy: Webhook
    webhook:
[...]
      conversionReviewVersions:
      - v1
      - v1beta1
  group: cluster.x-k8s.io
  names:
[...]
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Provider ID
[...]
    deprecated: true
    name: v1alpha3
    schema:
[...]
    served: false
    storage: false
    subresources:
      status: {}
  - additionalPrinterColumns:
[...]
    deprecated: true
    name: v1alpha4
    schema:
...]
    served: false
    storage: false
    subresources:
      status: {}
  - additionalPrinterColumns:
[...]
    name: v1beta1
    schema:
[...]
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    categories:
    - cluster-api
    kind: Machine
    listKind: MachineList
    plural: machines
    shortNames:
    - ma
    singular: machine
  conditions:
  - lastTransitionTime: "2024-08-19T09:58:32Z"
    message: no conflicts found
    reason: NoConflicts
    status: "True"
    type: NamesAccepted
  - lastTransitionTime: "2024-08-19T09:58:32Z"
    message: the initial names have been accepted
    reason: InitialNamesAccepted
    status: "True"
    type: Established
  storedVersions:
  - v1beta1

Expected behavior I think this particular resource should have the standard color (blue)

Screenshots image

Versions (please complete the following information):

wjiec commented 2 months ago

If a version in crd is “deprecated” or NOT “served” it will be red, you can check the VALID field to see why by ctrl + w.

ybizeul commented 2 months ago

Not sure I understand why a version not served AND deprecated would be a problem. Seems like pretty standard CRD lifecycle stuff or am I missing something ?

wjiec commented 2 months ago

Uh-huh, I think it's just “reusing” the color “red” by the way, it doesn't mean “error” or anything like that. Just highlighting it? 🤔️

ybizeul commented 2 months ago

Same as CrashLoopBackOff and Error containers ? In any case that's certainly something that drains more attention than it should.

wjiec commented 2 months ago

Indeed, it might be a bit better to change the color or express it in some other way (e.g. using 🗑 or ⚠️ or something like that)

kukacz commented 3 weeks ago

I'm experiencing the same issue. I wonder if perhaps this might share cause with https://github.com/derailed/k9s/issues/2842, ie. wrong (old) CRD API version being picked out of multiple ones present in the definition.