package openapi

import "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi"

Package openapi is a collection of libraries for fetching the openapi spec from a Kubernetes server and then indexing the type definitions. The openapi spec contains the object model definitions and extensions metadata such as the patchStrategy and patchMergeKey for creating patches.

Index

Constants

const PrintColumnsKey = "x-kubernetes-print-columns"

Functions

func GetPrintColumns

func GetPrintColumns(extensions spec.Extensions) (string, bool)

GetPrintColumns looks for the open API extension for the display columns.

func ParseGroupVersionKind

func ParseGroupVersionKind(s *openapi_v2.Schema) string

Get and parse GroupVersionKind from the extension. Returns empty if it doesn't have one.

Types

type Getter

type Getter interface {
	// OpenAPIData returns the parsed OpenAPIData
	Get() (openapi.Resources, error)
}

Getter is an interface for fetching openapi specs and parsing them into an Resources struct

func NewOpenAPIGetter

func NewOpenAPIGetter(openAPIClient discovery.OpenAPISchemaInterface) Getter

NewOpenAPIGetter returns an object to return OpenAPIDatas which reads from a server, and then stores in memory for subsequent invocations

Source Files

doc.go extensions.go gvk.go openapi_getter.go

Directories

PathSynopsis
pkg/kubectl/cmd/util/openapi/validation
Version
v1.8.0-beta.1
Published
Sep 8, 2017
Platform
js/wasm
Imports
6 packages
Last checked
6 minutes ago

Tools for package owners.