xcrd

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 6 modules, 12 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package xcrd generates CustomResourceDefinitions from Crossplane definitions.

v1.JSONSchemaProps is incompatible with controller-tools (as of 0.2.4) because it is missing JSON tags and uses float64, which is a disallowed type. We thus copy the entire struct as CRDSpecTemplate. See the below issue: https://github.com/kubernetes-sigs/controller-tools/issues/291

Index

Constants

View Source
const (
	CategoryClaim     = "claim"
	CategoryComposite = "composite"
)

Category names for generated claim and composite CRDs.

View Source
const (
	LabelKeyNamePrefixForComposed = "crossplane.io/composite"
	LabelKeyClaimName             = "crossplane.io/claim-name"
	LabelKeyClaimNamespace        = "crossplane.io/claim-namespace"
)

Label keys.

View Source
const (
	// AnnotationKeyCompositionResourceName is the name of the composite resource as described from a composition.
	AnnotationKeyCompositionResourceName = "crossplane.io/composition-resource-name"
)

Annotation keys.

View Source
const CompositionRevisionRef = "compositionRevisionRef"

CompositionRevisionRef should be propagated dynamically.

Variables

View Source
var PropagateSpecProps = []string{"compositionRef", "compositionSelector", "compositionUpdatePolicy", "compositionRevisionSelector"} //nolint:gochecknoglobals // We treat this as a constant.

PropagateSpecProps is the list of XRC spec properties to propagate when translating an XRC into an XR.

Functions

func BaseProps

func BaseProps() *extv1.JSONSchemaProps

BaseProps is a partial OpenAPIV3Schema for the spec fields that Crossplane expects to be present for all CRDs that it creates.

func CompositeResourceClaimPrinterColumns

func CompositeResourceClaimPrinterColumns() []extv1.CustomResourceColumnDefinition

CompositeResourceClaimPrinterColumns returns the set of default printer columns that should exist in all generated composite resource claim CRDs.

func CompositeResourceClaimSpecProps

func CompositeResourceClaimSpecProps(defaultPol *xpv2.CompositeDeletePolicy) map[string]extv1.JSONSchemaProps

CompositeResourceClaimSpecProps is a partial OpenAPIV3Schema for the spec fields that Crossplane expects to be present for all published infrastructure resources.

func CompositeResourcePrinterColumns

func CompositeResourcePrinterColumns(s v1.CompositeResourceScope) []extv1.CustomResourceColumnDefinition

CompositeResourcePrinterColumns returns the set of default printer columns that should exist in all generated composite resource CRDs.

func CompositeResourceSpecProps

func CompositeResourceSpecProps(s v1.CompositeResourceScope, defaultPol *xpv2.UpdatePolicy) map[string]extv1.JSONSchemaProps

CompositeResourceSpecProps is a partial OpenAPIV3Schema for the spec fields that Crossplane expects to be present for all defined composite resources.

func CompositeResourceStatusProps

func CompositeResourceStatusProps(s v1.CompositeResourceScope) map[string]extv1.JSONSchemaProps

CompositeResourceStatusProps is a partial OpenAPIV3Schema for the status fields that Crossplane expects to be present for all composite resources.

func ForCompositeResource

func ForCompositeResource(xrd *v1.CompositeResourceDefinition) (*extv1.CustomResourceDefinition, error)

ForCompositeResource derives the CustomResourceDefinition for a composite resource from the supplied CompositeResourceDefinition.

func ForCompositeResourceClaim

func ForCompositeResourceClaim(xrd *v1.CompositeResourceDefinition) (*extv1.CustomResourceDefinition, error)

ForCompositeResourceClaim derives the CustomResourceDefinition for a composite resource claim from the supplied CompositeResourceDefinition.

func GetCompositionResourceName

func GetCompositionResourceName(o metav1.Object) string

GetCompositionResourceName gets the name of the composition template used to reconcile a composed resource from its annotations.

func GetPropFields

func GetPropFields(props map[string]extv1.JSONSchemaProps) []string

GetPropFields returns the fields from a map of schema properties.

func IsEstablished

func IsEstablished(s extv1.CustomResourceDefinitionStatus) bool

IsEstablished is a helper function to check whether api-server is ready to accept the instances of registered CRD.

func SetCompositionResourceName

func SetCompositionResourceName(o metav1.Object, n string)

SetCompositionResourceName sets the name of the composition template used to reconcile a composed resource as an annotation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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