v1beta1

package
v0.0.0-...-e4690d8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

README

crd-validation

Forked from https://github.com/ant31/crd-validation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomResourceDefinitionTypeMeta = metav1.TypeMeta{
	Kind:       "CustomResourceDefinition",
	APIVersion: "apiextensions.k8s.io/v1beta1",
}

CustomResourceDefinitionTypeMeta set the default kind/apiversion of CRD

Functions

func EnumJSON

func EnumJSON(enum []interface{}) []extensionsobj.JSON

EnumJSON converts []interface{} to []JSON

func GetCustomResourceValidation

func GetCustomResourceValidation(name string, fn func(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition, options []func(map[string]common.OpenAPIDefinition)) *extensionsobj.CustomResourceValidation

GetCustomResourceValidation returns the validation definition for a CRD name

func GetCustomResourceValidations

func GetCustomResourceValidations(fn GetAPIDefinitions) map[string]*extensionsobj.CustomResourceValidation

GetCustomResourceValidations returns a CRD validation spec map. It took the openapi generated definition from kube-openapi as argument

func MarshallCrd

func MarshallCrd(w io.Writer, crd *extensionsobj.CustomResourceDefinition, outputFormat string) error

func NewCustomResourceDefinition

func NewCustomResourceDefinition(config Config, options ...func(map[string]common.OpenAPIDefinition)) *extensionsobj.CustomResourceDefinition

func OpenAPIRefCallBack

func OpenAPIRefCallBack(name string) spec.Ref

OpenAPIRefCallBack returns a jsonref using the input string without modification

func SchemPropsMapToJSONMap

func SchemPropsMapToJSONMap(schemaMap map[string]spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, nested bool) map[string]extensionsobj.JSONSchemaProps

SchemPropsMapToJSONMap converts map[string]Schema to map[string]JSONSchemaProps

func SchemaOrArrayToJSONItems

func SchemaOrArrayToJSONItems(schemaOrArray *spec.SchemaOrArray, openapiSpec map[string]common.OpenAPIDefinition, nested bool) *extensionsobj.JSONSchemaPropsOrArray

SchemaOrArrayToJSONItems converts *SchemaOrArray to *JSONSchemaPropsOrArray

func SchemaOrBoolToJSONProps

func SchemaOrBoolToJSONProps(schemaOrBool *spec.SchemaOrBool, openapiSpec map[string]common.OpenAPIDefinition, nested bool) *extensionsobj.JSONSchemaPropsOrBool

SchemaOrBoolToJSONProps converts *SchemaOrBool to *JSONSchemaPropsOrBool

func SchemaPropsToJSONProps

func SchemaPropsToJSONProps(schema *spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, nested bool) *extensionsobj.JSONSchemaProps

SchemaPropsToJSONProps converts a SchemaProps to a JSONProps

func SchemaPropsToJSONPropsArray

func SchemaPropsToJSONPropsArray(schemas []spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, nested bool) []extensionsobj.JSONSchemaProps

SchemaPropsToJSONPropsArray converts []Schema to []JSONSchemaProps

func StringOrArrayToString

func StringOrArrayToString(strOrArray spec.StringOrArray) string

StringOrArrayToString converts StringOrArray to string

func WaitForCRDReady

func WaitForCRDReady(restClient rest.Interface, crds []*crd_api.CustomResourceDefinition) error

Types

type Config

type Config struct {
	SpecDefinitionName       string
	EnableValidation         bool
	OutputFormat             string
	Labels                   Labels
	Annotations              Labels
	ResourceScope            string
	Group                    string
	Kind                     string
	Plural                   string
	Singular                 string
	ShortNames               []string
	Categories               []string
	GetOpenAPIDefinitions    GetAPIDefinitions
	EnableStatusSubresource  bool
	EnableScaleSubresource   bool
	Versions                 []extensionsobj.CustomResourceDefinitionVersion
	AdditionalPrinterColumns []extensionsobj.CustomResourceColumnDefinition
}

Config stores the user configuration input

type GetAPIDefinitions

type GetAPIDefinitions func(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition

GetAPIDefinition is a function returning a map with all Definition

type Labels

type Labels struct {
	LabelsString string
	LabelsMap    map[string]string
}

func (*Labels) Merge

func (labels *Labels) Merge(otherLabels map[string]string) map[string]string

Merge labels create a new map with labels merged.

func (*Labels) Set

func (labels *Labels) Set(value string) error

Implement the flag.Set interface

func (*Labels) String

func (labels *Labels) String() string

Implement the flag.Value interface

func (*Labels) Type

func (labels *Labels) Type() string

Jump to

Keyboard shortcuts

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