schema

command module
v0.0.0-...-1978b3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

Schema Tool

Schema is a seed of a CLI tool that a downstream can use to use reflection and go file inspection to generate a base version of OpenAPI for a CRD. The resulting schema will be used by Kubernetes to provide results from kubectl explain <type> calls, and type validation.

Knative does not currently support full CRD generation via tools like controller-gen, this tool is to be used to support managing CRD manifests manually.

Integration steps

Demo

Register the type you wish to expose in the CLI,

registry.Register(&example.LoremIpsum{})

Run the schema dump command for the you wish to have schema for,

cd ./schema
go run ./ dump LoremIpsum | pbcopy

Paste this inside the CRD for LoremIpsum,

...
      schema:
        openAPIV3Schema:
          <**paste**>
      additionalPrinterColumns:
...
Downstream

Start with example.go, copy this into the downstream and modify which kinds are registered via registry.Register. You can register more than one kind at a time. (TODO: support versions in the CLI.)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL