tektoncd / operator

Kubernetes operator to manage installation, updation and uninstallation of tektoncd projects (pipeline, …)
Apache License 2.0
445 stars 198 forks source link

CustomResourceDefinitions Do Not Have Metadata For "explain" response #582

Open InfoSec812 opened 2 years ago

InfoSec812 commented 2 years ago

Expected Behavior

Given that the Tekton operator is installed on an OpenShift cluster When I execute oc explain <TektonResource> Then I expect to see information documenting the API and Resources

Actual Behavior

$ oc explain EventListener
KIND:     EventListener
VERSION:  triggers.tekton.dev/v1beta1

DESCRIPTION:
     <empty>

Steps to Reproduce the Problem

  1. Log on to an OpenShift cluster via CLI where Tekton is installed
  2. Run oc explain --recursive EventListener
  3. Note that there is no explanation

Additional Info

❯ tkn version
Client version: 0.21.0
Pipeline version: v0.28.2
Triggers version: v0.16.1
InfoSec812 commented 2 years ago

An example of a proper response would be:

❯ oc explain --recursive ConfigMap
KIND:     ConfigMap
VERSION:  v1

DESCRIPTION:
     ConfigMap holds configuration data for pods to consume.

FIELDS:
   apiVersion   <string>
   binaryData   <map[string]string>
   data <map[string]string>
   immutable    <boolean>
   kind <string>
   metadata     <Object>
      annotations       <map[string]string>
      clusterName       <string>
      creationTimestamp <string>
      deletionGracePeriodSeconds        <integer>
      deletionTimestamp <string>
      finalizers        <[]string>
      generateName      <string>
      generation        <integer>
      labels    <map[string]string>
      managedFields     <[]Object>
         apiVersion     <string>
         fieldsType     <string>
         fieldsV1       <map[string]>
         manager        <string>
         operation      <string>
         subresource    <string>
         time   <string>
      name      <string>
      namespace <string>
      ownerReferences   <[]Object>
         apiVersion     <string>
         blockOwnerDeletion     <boolean>
         controller     <boolean>
         kind   <string>
         name   <string>
         uid    <string>
      resourceVersion   <string>
      selfLink  <string>
      uid       <string>
nikhil-thomas commented 2 years ago

+ 💯 This can definitely improve developer experience.

We shall try to work with the TektonCD community and get this in for CRDs coming from each indidual projects (TektonPipeline, TektonTriggers...).

To start with we shall try to do this for the CRD definitions in operaotor (eg: TektonConfig).

cc @vdemeester

nikhil-thomas commented 2 years ago

This PR: https://github.com/tektoncd/pipeline/pull/1776 is a good reference on how to generate it automatically. In addition, Knative is doing it already.

ref: https://github.com/knative/serving/blob/main/hack/update-schemas.sh

tekton-robot commented 2 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

InfoSec812 commented 2 years ago

/remove-lifecycle stale

Issue is still awaiting a resolution

vdemeester commented 2 years ago

/lifecycle frozen