utils

package
v0.0.0-...-f2f9c23 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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) *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 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

Types

type GetAPIDefinitions

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

GetAPIDefinition is a function returning a map with all Definition

Jump to

Keyboard shortcuts

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