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

After upgrade lens, crd additionalPrinterColumns doesn't work #4539

Closed
chenmeng1996 opened this issue Dec 9, 2021 · 5 comments · Fixed by #4553
Closed

After upgrade lens, crd additionalPrinterColumns doesn't work #4539

chenmeng1996 opened this issue Dec 9, 2021 · 5 comments · Fixed by #4553
Assignees
Labels
bug Something isn't working

Comments

@chenmeng1996
Copy link

Describe the bug
After upgrade lens, crd additionalPrinterColumns doesn't work. Custom columns are no longer visible on Lens. But I can see custom columns when use kubectl get in terminal of lens.

To Reproduce
Any crd additionalPrinterColumns can not work.

Expected behavior
After crd additionalPrinterColumns has been set, Custom columns are visible on Lens.

Screenshots
image
image

Environment (please complete the following information):

  • Lens Version: 5.3.2-latest.20211201.1
  • OS: OSX

Additional context
By the way, the problem is not new, it has been in several recent versions.

@chenmeng1996 chenmeng1996 added the bug Something isn't working label Dec 9, 2021
@Nokel81
Copy link
Collaborator

Nokel81 commented Dec 9, 2021

What apiVersion does your CRD use? Also can you provide the CRD itself? Because I cannot reproduce this.

@chenmeng1996
Copy link
Author

chenmeng1996 commented Dec 10, 2021

What apiVersion does your CRD use? Also can you provide the CRD itself? Because I cannot reproduce this.

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: daemonsets.apps.kruise.io
  selfLink: >-
    /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/daemonsets.apps.kruise.io
  uid: 09e2f356-51a0-11eb-87c3-fa163e89c62c
  resourceVersion: '644'
  generation: 1
  creationTimestamp: '2021-01-08T10:55:36Z'
  labels:
    app.kubernetes.io/managed-by: Helm
  annotations:
    controller-gen.kubebuilder.io/version: v0.2.9
    meta.helm.sh/release-name: kruise
    meta.helm.sh/release-namespace: default
status:
  conditions:
    - type: NamesAccepted
      status: 'True'
      lastTransitionTime: '2021-01-08T10:55:36Z'
      reason: NoConflicts
      message: no conflicts found
    - type: Established
      status: 'True'
      lastTransitionTime: null
      reason: InitialNamesAccepted
      message: the initial names have been accepted
  acceptedNames:
    plural: daemonsets
    singular: daemonset
    shortNames:
      - daemon
    kind: DaemonSet
    listKind: DaemonSetList
  storedVersions:
    - v1alpha1
spec:
  group: apps.kruise.io
  version: v1alpha1
  names:
    plural: daemonsets
    singular: daemonset
    shortNames:
      - daemon
    kind: DaemonSet
    listKind: DaemonSetList
  scope: Namespaced
  validation:
    openAPIV3Schema:
      description: DaemonSet is the Schema for the daemonsets API
      type: object
      properties:
        apiVersion:
          description: >-
            APIVersion defines the versioned schema of this representation of an
            object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info:
            https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
          type: string
        kind:
          description: >-
            Kind is a string value representing the REST resource this object
            represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info:
            https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
          type: string
        metadata:
          type: object
        spec:
          description: DaemonSetSpec defines the desired state of DaemonSet
          type: object
          required:
            - selector
            - template
          properties:
            burstReplicas:
              description: >-
                BurstReplicas is a rate limiter for booting pods on a lot of
                pods. The default value is 250
              anyOf:
                - type: integer
                - type: string
            minReadySeconds:
              description: >-
                The minimum number of seconds for which a newly created
                DaemonSet pod should be ready without any of its container
                crashing, for it to be considered available. Defaults to 0 (pod
                will be considered available as soon as it is ready).
              type: integer
              format: int32
            revisionHistoryLimit:
              description: >-
                The number of old history to retain to allow rollback. This is a
                pointer to distinguish between explicit zero and not specified.
                Defaults to 10.
              type: integer
              format: int32
            selector:
              description: >-
                A label query over pods that are managed by the daemon set. Must
                match in order to be controlled. It must match the pod
                template's labels. More info:
                https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
              type: object
              properties:
                matchExpressions:
                  description: >-
                    matchExpressions is a list of label selector requirements.
                    The requirements are ANDed.
                  type: array
                  items:
                    description: >-
                      A label selector requirement is a selector that contains
                      values, a key, and an operator that relates the key and
                      values.
                    type: object
                    required:
                      - key
                      - operator
                    properties:
                      key:
                        description: key is the label key that the selector applies to.
                        type: string
                      operator:
                        description: >-
                          operator represents a key's relationship to a set of
                          values. Valid operators are In, NotIn, Exists and
                          DoesNotExist.
                        type: string
                      values:
                        description: >-
                          values is an array of string values. If the operator
                          is In or NotIn, the values array must be non-empty. If
                          the operator is Exists or DoesNotExist, the values
                          array must be empty. This array is replaced during a
                          strategic merge patch.
                        type: array
                        items:
                          type: string
                matchLabels:
                  description: >-
                    matchLabels is a map of {key,value} pairs. A single
                    {key,value} in the matchLabels map is equivalent to an
                    element of matchExpressions, whose key field is "key", the
                    operator is "In", and the values array contains only
                    "value". The requirements are ANDed.
                  type: object
                  additionalProperties:
                    type: string
            template:
              description: >-
                An object that describes the pod that will be created. The
                DaemonSet will create exactly one copy of this pod on every node
                that matches the template's node selector (or on every node if
                no node selector is specified). More info:
                https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
              type: object
            updateStrategy:
              description: >-
                An update strategy to replace existing DaemonSet pods with new
                pods.
              type: object
              properties:
                rollingUpdate:
                  description: >-
                    Rolling update config params. Present only if type =
                    "RollingUpdate".
                  type: object
                  properties:
                    maxSurge:
                      description: >-
                        Only when type=SurgingRollingUpdateType, it works. The
                        maximum number of DaemonSet pods that can be scheduled
                        above the desired number of pods during the update.
                        Value can be an absolute number (ex: 5) or a percentage
                        of the total number of DaemonSet pods at the start of
                        the update (ex: 10%). The absolute number is calculated
                        from the percentage by rounding up. This cannot be 0.
                        The default value is 1. Example: when this is set to
                        30%, at most 30% of the total number of nodes that
                        should be running the daemon pod (i.e.
                        status.desiredNumberScheduled) can have 2 pods running
                        at any given time. The update starts by starting
                        replacements for at most 30% of those DaemonSet pods.
                        Once the new pods are available it then stops the
                        existing pods before proceeding onto other DaemonSet
                        pods, thus ensuring that at most 130% of the desired
                        final number of DaemonSet  pods are running at all times
                        during the update.
                      anyOf:
                        - type: integer
                        - type: string
                    maxUnavailable:
                      description: >-
                        The maximum number of DaemonSet pods that can be
                        unavailable during the update. Value can be an absolute
                        number (ex: 5) or a percentage of total number of
                        DaemonSet pods at the start of the update (ex: 10%).
                        Absolute number is calculated from percentage by
                        rounding up. This cannot be 0. Default value is 1.
                        Example: when this is set to 30%, at most 30% of the
                        total number of nodes that should be running the daemon
                        pod (i.e. status.desiredNumberScheduled) can have their
                        pods stopped for an update at any given time. The update
                        starts by stopping at most 30% of those DaemonSet pods
                        and then brings up new DaemonSet pods in their place.
                        Once the new pods are available, it then proceeds onto
                        other DaemonSet pods, thus ensuring that at least 70% of
                        original number of DaemonSet pods are available at all
                        times during the update.
                      anyOf:
                        - type: integer
                        - type: string
                    partition:
                      description: >-
                        The number of DaemonSet pods remained to be old version.
                        Default value is 0. Maximum value is
                        status.DesiredNumberScheduled, which means no pod will
                        be updated.
                      type: integer
                      format: int32
                    paused:
                      description: >-
                        Indicates that the daemon set is paused and will not be
                        processed by the daemon set controller.
                      type: boolean
                    rollingUpdateType:
                      description: Type is to specify which kind of rollingUpdate.
                      type: string
                    selector:
                      description: >-
                        A label query over nodes that are managed by the daemon
                        set RollingUpdate. Must match in order to be controlled.
                        It must match the node's labels.
                      type: object
                      properties:
                        matchExpressions:
                          description: >-
                            matchExpressions is a list of label selector
                            requirements. The requirements are ANDed.
                          type: array
                          items:
                            description: >-
                              A label selector requirement is a selector that
                              contains values, a key, and an operator that
                              relates the key and values.
                            type: object
                            required:
                              - key
                              - operator
                            properties:
                              key:
                                description: >-
                                  key is the label key that the selector applies
                                  to.
                                type: string
                              operator:
                                description: >-
                                  operator represents a key's relationship to a
                                  set of values. Valid operators are In, NotIn,
                                  Exists and DoesNotExist.
                                type: string
                              values:
                                description: >-
                                  values is an array of string values. If the
                                  operator is In or NotIn, the values array must
                                  be non-empty. If the operator is Exists or
                                  DoesNotExist, the values array must be empty.
                                  This array is replaced during a strategic
                                  merge patch.
                                type: array
                                items:
                                  type: string
                        matchLabels:
                          description: >-
                            matchLabels is a map of {key,value} pairs. A single
                            {key,value} in the matchLabels map is equivalent to
                            an element of matchExpressions, whose key field is
                            "key", the operator is "In", and the values array
                            contains only "value". The requirements are ANDed.
                          type: object
                          additionalProperties:
                            type: string
                type:
                  description: >-
                    Type of daemon set update. Can be "RollingUpdate" or
                    "OnDelete". Default is RollingUpdate.
                  type: string
        status:
          description: DaemonSetStatus defines the observed state of DaemonSet
          type: object
          required:
            - currentNumberScheduled
            - daemonSetHash
            - desiredNumberScheduled
            - numberMisscheduled
            - numberReady
            - updatedNumberScheduled
          properties:
            collisionCount:
              description: >-
                Count of hash collisions for the DaemonSet. The DaemonSet
                controller uses this field as a collision avoidance mechanism
                when it needs to create the name for the newest
                ControllerRevision.
              type: integer
              format: int32
            conditions:
              description: >-
                Represents the latest available observations of a DaemonSet's
                current state.
              type: array
              items:
                description: >-
                  DaemonSetCondition describes the state of a DaemonSet at a
                  certain point.
                type: object
                required:
                  - status
                  - type
                properties:
                  lastTransitionTime:
                    description: >-
                      Last time the condition transitioned from one status to
                      another.
                    type: string
                    format: date-time
                  message:
                    description: >-
                      A human readable message indicating details about the
                      transition.
                    type: string
                  reason:
                    description: The reason for the condition's last transition.
                    type: string
                  status:
                    description: Status of the condition, one of True, False, Unknown.
                    type: string
                  type:
                    description: Type of DaemonSet condition.
                    type: string
            currentNumberScheduled:
              description: >-
                The number of nodes that are running at least 1 daemon pod and
                are supposed to run the daemon pod. More info:
                https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
              type: integer
              format: int32
            daemonSetHash:
              description: >-
                DaemonSetHash is the controller-revision-hash, which represents
                the latest version of the DaemonSet.
              type: string
            desiredNumberScheduled:
              description: >-
                The total number of nodes that should be running the daemon pod
                (including nodes correctly running the daemon pod). More info:
                https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
              type: integer
              format: int32
            numberAvailable:
              description: >-
                The number of nodes that should be running the daemon pod and
                have one or more of the daemon pod running and available (ready
                for at least spec.minReadySeconds)
              type: integer
              format: int32
            numberMisscheduled:
              description: >-
                The number of nodes that are running the daemon pod, but are not
                supposed to run the daemon pod. More info:
                https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
              type: integer
              format: int32
            numberReady:
              description: >-
                The number of nodes that should be running the daemon pod and
                have one or more of the daemon pod running and ready.
              type: integer
              format: int32
            numberUnavailable:
              description: >-
                The number of nodes that should be running the daemon pod and
                have none of the daemon pod running and available (ready for at
                least spec.minReadySeconds)
              type: integer
              format: int32
            observedGeneration:
              description: >-
                The most recent generation observed by the daemon set
                controller.
              type: integer
              format: int64
            updatedNumberScheduled:
              description: The total number of nodes that are running updated daemon pod
              type: integer
              format: int32
  subresources:
    status: {}
  versions:
    - name: v1alpha1
      served: true
      storage: true
  additionalPrinterColumns:
    - name: DesiredNumber
      type: integer
      description: The desired number of pods.
      JSONPath: .status.desiredNumberScheduled
    - name: CurrentNumber
      type: integer
      description: The current number of pods.
      JSONPath: .status.currentNumberScheduled
    - name: UpdatedNumberScheduled
      type: integer
      description: The updated number of pods.
      JSONPath: .status.updatedNumberScheduled
    - name: AGE
      type: date
      description: >-
        CreationTimestamp is a timestamp representing the server time when this
        object was created. It is not guaranteed to be set in happens-before
        order across separate operations. Clients may not set this value. It is
        represented in RFC3339 form and is in UTC.
      JSONPath: .metadata.creationTimestamp
  conversion:
    strategy: None

@Nokel81
Copy link
Collaborator

Nokel81 commented Dec 10, 2021

What version of kubernetes are you using?

@Nokel81
Copy link
Collaborator

Nokel81 commented Dec 10, 2021

Reproduced using kubernetes v1.14

@chenmeng1996
Copy link
Author

What version of kubernetes are you using?

v1.14.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants