Documentation ¶
Index ¶
- Variables
- func EnumJSON(enum []interface{}) []extensionsobj.JSON
- func GetCustomResourceValidation(name string, ...) *extensionsobj.CustomResourceValidation
- func GetCustomResourceValidations(fn GetAPIDefinitions) map[string]*extensionsobj.CustomResourceValidation
- func InitFlags(cfg *Config, flagset *flag.FlagSet) *flag.FlagSet
- func MarshallCrd(crd *extensionsobj.CustomResourceDefinition, outputFormat string) error
- func NewCustomResourceDefinition(config Config) *extensionsobj.CustomResourceDefinition
- func OpenAPIRefCallBack(name string) spec.Ref
- func SchemPropsMapToJSONMap(schemaMap map[string]spec.Schema, ...) map[string]extensionsobj.JSONSchemaProps
- func SchemaOrArrayToJSONItems(schemaOrArray *spec.SchemaOrArray, ...) *extensionsobj.JSONSchemaPropsOrArray
- func SchemaOrBoolToJSONProps(schemaOrBool *spec.SchemaOrBool, ...) *extensionsobj.JSONSchemaPropsOrBool
- func SchemaPropsToJSONProps(schema *spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, ...) *extensionsobj.JSONSchemaProps
- func SchemaPropsToJSONPropsArray(schemas []spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, ...) []extensionsobj.JSONSchemaProps
- func StringOrArrayToString(strOrArray spec.StringOrArray) string
- type Config
- type GetAPIDefinitions
- type Labels
Constants ¶
This section is empty.
Variables ¶
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 MarshallCrd ¶
func MarshallCrd(crd *extensionsobj.CustomResourceDefinition, outputFormat string) error
func NewCustomResourceDefinition ¶
func NewCustomResourceDefinition(config Config) *extensionsobj.CustomResourceDefinition
func OpenAPIRefCallBack ¶
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 Config ¶
type Config struct { SpecDefinitionName string EnableValidation bool OutputFormat string Labels Labels Annotations Labels ResourceScope string Group string Kind string Version string Plural string SpecReplicasPath string StatusReplicasPath string LabelSelectorPath string Categories []string ShortNames []string GetOpenAPIDefinitions GetAPIDefinitions }
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