Documentation ¶
Overview ¶
Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func ConvertJSONSchemaPropsToSpecSchema(props *extv1.JSONSchemaProps) (*spec.Schema, error)
- func GenerateSchemaFromEvals(evals map[string][]ref.Val) (*extv1.JSONSchemaProps, error)
- func GetResourceTopLevelFieldNames(schema *spec.Schema) []string
- func NewCombinedResolver(clientConfig *rest.Config) (resolver.SchemaResolver, *discovery.DiscoveryClient, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEvaluationTypes is returned when the evaluation types are not valid // for generating a schema. ErrInvalidEvaluationTypes = errors.New("invalid evaluation type") )
Functions ¶
func ConvertJSONSchemaPropsToSpecSchema ¶
func ConvertJSONSchemaPropsToSpecSchema(props *extv1.JSONSchemaProps) (*spec.Schema, error)
ConvertJSONSchemaPropsToSpecSchema converts an extv1.JSONSchemaProps to a spec.Schema.
NOTE(a-hilaly): there must be an upstream library that does this conversion, but life is too short to find it. So I'm just going to write this function here.
func GenerateSchemaFromEvals ¶
func GetResourceTopLevelFieldNames ¶
GetResourceTopLevelFieldNames returns the top level field names of the resource. It walks through the schema of the resource and retrieves the top level fields including spec, status, metadata, etc.
It is up to the caller to sort filter the field names they want.
func NewCombinedResolver ¶
func NewCombinedResolver(clientConfig *rest.Config) (resolver.SchemaResolver, *discovery.DiscoveryClient, error)
NewCombinedResolver creates a new schema resolver that can resolve both core and client types.
Types ¶
This section is empty.