open-policy-agent / open-policy-agent/frameworks

Improve support for `kubectl explain`

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
127
Forks
61
Avg merge
1d 17h
Merged PRs (30d)
13

Description

Currently, pointing the kubectl explain command at a constraint yields no description. spec and status are also missing descriptions. See this example:

❯ kubectl explain k8srequiredlabels
Alias tip: k explain k8srequiredlabels
KIND:     K8sRequiredLabels
VERSION:  constraints.gatekeeper.sh/v1beta1

DESCRIPTION:
     <empty>

FIELDS:
   apiVersion   <string>
     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

   kind <string>
     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

   metadata     <Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

   spec <Object>

   status       <>

Doing this will require placing description information in the right place in Constraint CRDs. This comment from Jordan Liggitt suggests that structural schemas should do most of the heavy lifting here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Constraint CRDs are defined and how their structural schemas are consumed by kubectl explain. Add description information for the constraint, spec, and status fields in the appropriate CRD schemas, then verify that kubectl explain displays those descriptions instead of empty output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.