const ( ApiDomain = "cnrm.cloud.google.com" ManagedByKCCLabel = "cnrm.cloud.google.com/managed-by-kcc" GCPCategory = "gcp" )
const (
Dcl2CRDLabel = "cnrm.cloud.google.com/dcl2crd"
)
const (
TF2CRDLabel = "cnrm.cloud.google.com/tf2crd"
)
var ( UnsupportedReferencedResource = fmt.Errorf("referenced resource is unsupported by KCC") )
func FileNameForCRD(crd *apiextensions.CustomResourceDefinition) (string, error)
FileNameForCRD determines the file name for the given CRD. File names take the form of "$group_$version_$kind.yaml" Example: "pubsub_v1alpha1_pubsubtopic.yaml"
func GenerateResourceIDFieldDescription(targetField string, isServerGeneratedResourceID bool) string
func GenerateShortNames(kind string) []string
func GenerateTF2CRD(sm *corekccv1alpha1.ServiceMapping, resourceConfig *corekccv1alpha1.ResourceConfig) (*apiextensions.CustomResourceDefinition, error)
func GetCustomResourceDefinition(kind, group, version string, openAPIV3Schema *apiextensions.JSONSchemaProps, engineLabel string) *apiextensions.CustomResourceDefinition
func GetResourceReferenceSchemaFromTypeConfig(typeConfig corekccv1alpha1.TypeConfig) *apiextensions.JSONSchemaProps
func MarkHierarchicalReferencesOptionalButMutuallyExclusive(spec *apiextensions.JSONSchemaProps, hierarchicalRefs []corekccv1alpha1.HierarchicalReference) *apiextensions.JSONSchemaProps
MarkHierarchicalReferencesOptionalButMutuallyExclusive returns a modified copy of the given JSON schema so that keys for hierarchical references are marked optional but mutually exclusive (i.e. at most one may be specified).
func MarkHierarchicalReferencesRequiredButMutuallyExclusive(spec *apiextensions.JSONSchemaProps, hierarchicalRefs []corekccv1alpha1.HierarchicalReference) *apiextensions.JSONSchemaProps
MarkHierarchicalReferencesRequiredButMutuallyExclusive returns a modified copy of the given JSON schema so that keys for hierarchical references are marked required but mutually exclusive (i.e. one and only one must be specified).
func MarkReferencedKindsNotSupported(refSchema *apiextensions.JSONSchemaProps, kinds []string)
MarkReferencedKindsNotSupported changes the description of the direct reference field 'name' to reflect that some of the referenced resource types are not yet supported in KCC.
type DCL2CRDGenerator struct {
// contains filtered or unexported fields
}
func New(metadataLoader dclmetatda.ServiceMetadataLoader, schemaLoader dclschemaloader.DCLSchemaLoader, allSupportedGVKs []schema.GroupVersionKind) *DCL2CRDGenerator
func (a *DCL2CRDGenerator) GenerateCRDFromOpenAPISchema(schema *openapi.Schema, gvk schema.GroupVersionKind) (*apiextensions.CustomResourceDefinition, error)
GenerateCRDFromOpenAPISchema returns a CustomResourceDefinition given the DCL OpenAPI schema
Name | Synopsis |
---|---|
.. | |
crdboilerplate |