operator icon indicating copy to clipboard operation
operator copied to clipboard

CustomResourceDefinitions Do Not Have Metadata For "explain" response

Open InfoSec812 opened this issue 2 years ago • 6 comments

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

  • Kubernetes version:
❯ oc version
Client Version: v4.2.0-alpha.0-657-g51011e4
Server Version: 4.9.12
Kubernetes Version: v1.22.3+e790d7f
  • Tekton Pipeline version:
❯ tkn version
Client version: 0.21.0
Pipeline version: v0.28.2
Triggers version: v0.16.1

InfoSec812 avatar Jan 18 '22 13:01 InfoSec812

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>

InfoSec812 avatar Jan 18 '22 13:01 InfoSec812

+ 💯 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).

  • additional context:
  • https://github.com/tektoncd/pipeline/pull/1179
  • https://github.com/tektoncd/pipeline/pull/1776

cc @vdemeester

nikhil-thomas avatar Jan 19 '22 01:01 nikhil-thomas

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

nikhil-thomas avatar Jan 20 '22 10:01 nikhil-thomas

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.

tekton-robot avatar Apr 20 '22 11:04 tekton-robot

/remove-lifecycle stale

Issue is still awaiting a resolution

InfoSec812 avatar Apr 20 '22 11:04 InfoSec812

/lifecycle frozen

vdemeester avatar Apr 20 '22 14:04 vdemeester