Documentation
¶
Overview ¶
+k8s:deepcopy-gen=package,register +groupName=apis.kcp.dev
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type APIBinding
- type APIBindingList
- type APIBindingPhaseType
- type APIBindingSpec
- type APIBindingStatus
- type APIExport
- type APIExportList
- type APIExportSpec
- type APIExportStatus
- type APIResourceSchema
- type APIResourceSchemaList
- type APIResourceSchemaSpec
- type APIResourceVersion
- type BoundAPIResource
- type BoundAPIResourceSchema
- type ExportReference
- type WorkspaceExportReference
Constants ¶
const ( // APIExportValid is a condition for APIBinding that reflects the validity of the referenced APIExport. APIExportValid conditionsv1alpha1.ConditionType = "APIExportValid" // APIExportInvalidReferenceReason is a reason for APIExportValid condition of APIBinding that the referenced APIExport reference is invalid. APIExportInvalidReferenceReason = "APIExportInvalidReference" // APIExportNotFoundReason is a reason for APIExportValid condition that the referenced APIExport is not found. APIExportNotFoundReason = "APIExportNotFound" // CRDReady is a condition for APIBinding that reflects that the referenced CRDs are ready. CRDReady conditionsv1alpha1.ConditionType = "CRDReady" // APIResourceSchemaNotFoundReason is a reason for CRDReady condition that the referenced APIResourceSchemas has not been found. APIResourceSchemaNotFoundReason = "APIResourceSchemaNotFound" // InvalidSchemaReason is a reason for CRDReady condition that the referenced APIResoureSchema cannot be converted to a CRD. InvalidSchemaReason = "InvalidSchema" // CreateErrorReason is a reason for CRDReady condition that the referenced CRDs cannot be created. CreateErrorReason = "CreateError" // UpdateErrorReason is a reason for CRDReady condition that the referenced CRDs cannot be updated. UpdateErrorReason = "UpdateError" // WaitingForEstablishedReason is a reason for CRDReady condition that the referenced CRDs are not ready. WaitingForEstablishedReason = "WaitingForEstablished" )
These are valid conditions of APIBinding.
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: apis.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type APIBinding ¶
type APIBinding struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec holds the desired state.
// +required
// +kubebuilder:validation:Required
Spec APIBindingSpec `json:"spec,omitempty"`
// Status communicates the observed state.
// +optional
Status APIBindingStatus `json:"status,omitempty"`
}
APIBinding enables a set of resources and their behaviour through an external service provider in this workspace.
The service provider uses an APIExport to expose the API.
+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp
func (*APIBinding) DeepCopy ¶
func (in *APIBinding) DeepCopy() *APIBinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIBinding.
func (*APIBinding) DeepCopyInto ¶
func (in *APIBinding) DeepCopyInto(out *APIBinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIBinding) DeepCopyObject ¶
func (in *APIBinding) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*APIBinding) GetConditions ¶
func (in *APIBinding) GetConditions() conditionsv1alpha1.Conditions
func (*APIBinding) SetConditions ¶
func (in *APIBinding) SetConditions(conditions conditionsv1alpha1.Conditions)
type APIBindingList ¶
type APIBindingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []APIBinding `json:"items"`
}
APIBindingList is a list of APIBinding resources
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*APIBindingList) DeepCopy ¶
func (in *APIBindingList) DeepCopy() *APIBindingList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIBindingList.
func (*APIBindingList) DeepCopyInto ¶
func (in *APIBindingList) DeepCopyInto(out *APIBindingList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIBindingList) DeepCopyObject ¶
func (in *APIBindingList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type APIBindingPhaseType ¶
type APIBindingPhaseType string
APIBindingPhaseType is the type of the current phase of an APIBinding.
const ( APIBindingPhaseBinding APIBindingPhaseType = "Binding" APIBindingPhaseBound APIBindingPhaseType = "Bound" APIBindingPhaseRebinding APIBindingPhaseType = "Rebinding" DefaultAPIBindingInitializer = "apis.kcp.dev/binding" )
type APIBindingSpec ¶
type APIBindingSpec struct {
// reference uniquely identifies an API to bind to.
//
// +required
// +kubebuilder:validation:Required
Reference ExportReference `json:"reference"`
}
APIBindingSpec records the APIs and implementations that are to be bound.
func (*APIBindingSpec) DeepCopy ¶
func (in *APIBindingSpec) DeepCopy() *APIBindingSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIBindingSpec.
func (*APIBindingSpec) DeepCopyInto ¶
func (in *APIBindingSpec) DeepCopyInto(out *APIBindingSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIBindingStatus ¶
type APIBindingStatus struct {
// boundExport records the export this binding is bound to currently. It can
// differ from the export that was specified in the spec while rebinding
// to a different APIExport.
//
// This field is what gives the APIExport visibility into the objects in this
// workspace.
//
// +optional
BoundAPIExport *ExportReference `json:"boundExport,omitempty"`
// boundResources records the state of bound APIs.
//
// +optional
// +listType=map
// +listMapKey=group
// +listMapKey=resource
BoundResources []BoundAPIResource `json:"boundResources,omitempty"`
// initializers tracks the binding process of the APIBinding. The APIBinding cannot
// be moved to Bound until the initializers have finished their work. Initializers are
// added before transition to Initializing phase and verified through admission to be
// complete when initialization starts.
//
// +optional
Initializers []string `json:"initializers,omitempty"`
// phase is the current phase of the APIBinding:
// - "": the APIBinding has just been created, waiting to be bound.
// - Binding: the APIBinding is being bound.
// - Bound: the APIBinding is bound and the referenced APIs are available in the workspace.
//
// +optional
// +kubebuilder:validation:Enum="";Binding;Bound
Phase APIBindingPhaseType `json:"phase,omitempty"`
// conditions is a list of conditions that apply to the APIBinding.
//
// +optional
Conditions conditionsv1alpha1.Conditions `json:"conditions,omitempty"`
}
APIBindingStatus records which schemas are bound.
func (*APIBindingStatus) DeepCopy ¶
func (in *APIBindingStatus) DeepCopy() *APIBindingStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIBindingStatus.
func (*APIBindingStatus) DeepCopyInto ¶
func (in *APIBindingStatus) DeepCopyInto(out *APIBindingStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIExport ¶
type APIExport struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec holds the desired state.
//
// +optional
Spec APIExportSpec `json:"spec,omitempty"`
// Status communicates the observed state.
//
// +optional
Status APIExportStatus `json:"status,omitempty"`
}
APIExport registers an API and implementation to allow consumption by others through APIBindings.
APIExports cannot be deleted until status.resourceSchemasInUse is empty.
+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp
func (*APIExport) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIExport.
func (*APIExport) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIExport) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type APIExportList ¶
type APIExportList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []APIExport `json:"items"`
}
APIExportList is a list of APIExport resources
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*APIExportList) DeepCopy ¶
func (in *APIExportList) DeepCopy() *APIExportList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIExportList.
func (*APIExportList) DeepCopyInto ¶
func (in *APIExportList) DeepCopyInto(out *APIExportList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIExportList) DeepCopyObject ¶
func (in *APIExportList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type APIExportSpec ¶
type APIExportSpec struct {
// latestResourceSchemas records the latest APIResourceSchemas that are exposed
// with this APIExport.
//
// The schemas can be changed in the life-cycle of the APIExport. These changes
// have no effect on existing APIBindings, but only on newly bound ones.
//
// For updating existing APIBindings, use an APIDeployment keeping bound
// workspaces up-to-date.
//
// +optional
// +listType=set
LatestResourceSchemas []string `json:"latestResourceSchemas,omitempty"`
}
APIExportSpec defines the desired state of APIExport.
func (*APIExportSpec) DeepCopy ¶
func (in *APIExportSpec) DeepCopy() *APIExportSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIExportSpec.
func (*APIExportSpec) DeepCopyInto ¶
func (in *APIExportSpec) DeepCopyInto(out *APIExportSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIExportStatus ¶
type APIExportStatus struct {
}
APIExportStatus defines the observed state of APIExport.
func (*APIExportStatus) DeepCopy ¶
func (in *APIExportStatus) DeepCopy() *APIExportStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIExportStatus.
func (*APIExportStatus) DeepCopyInto ¶
func (in *APIExportStatus) DeepCopyInto(out *APIExportStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIResourceSchema ¶
type APIResourceSchema struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec holds the desired state.
//
// +optional
Spec APIResourceSchemaSpec `json:"spec,omitempty"`
}
APIResourceSchema describes a resource, identified by (group, version, resource, schema).
A APIResourceSchema is immutable and cannot be deleted if they are referenced by an APIExport in the same workspace.
+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:resource:scope=Cluster,categories=kcp
func (*APIResourceSchema) DeepCopy ¶
func (in *APIResourceSchema) DeepCopy() *APIResourceSchema
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceSchema.
func (*APIResourceSchema) DeepCopyInto ¶
func (in *APIResourceSchema) DeepCopyInto(out *APIResourceSchema)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIResourceSchema) DeepCopyObject ¶
func (in *APIResourceSchema) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type APIResourceSchemaList ¶
type APIResourceSchemaList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []APIResourceSchema `json:"items"`
}
APIResourceSchemaList is a list of APIResourceSchema resources
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*APIResourceSchemaList) DeepCopy ¶
func (in *APIResourceSchemaList) DeepCopy() *APIResourceSchemaList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceSchemaList.
func (*APIResourceSchemaList) DeepCopyInto ¶
func (in *APIResourceSchemaList) DeepCopyInto(out *APIResourceSchemaList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIResourceSchemaList) DeepCopyObject ¶
func (in *APIResourceSchemaList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type APIResourceSchemaSpec ¶
type APIResourceSchemaSpec struct {
// group is the API group of the defined custom resource. Empty string means the
// core API group. The resources are served under `/apis/<group>/...` or `/api` for the core group.
//
// +required
Group string `json:"group"`
// names specify the resource and kind names for the custom resource.
//
// +required
Names apiextensionsv1.CustomResourceDefinitionNames `json:"names"`
// scope indicates whether the defined custom resource is cluster- or namespace-scoped.
// Allowed values are `Cluster` and `Namespaced`.
//
// +required
// +kubebuilder:validation:Enum=Cluster;Namespaced
Scope apiextensionsv1.ResourceScope `json:"scope"`
// versions is the API version of the defined custom resource.
//
// Note: the OpenAPI v3 schemas must be equal for all versions until CEL
// version migration is supported.
//
// +required
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MinItems=1
Versions []APIResourceVersion `json:"versions"`
}
APIResourceSchemaSpec defines the desired state of APIResourceSchema.
func (*APIResourceSchemaSpec) DeepCopy ¶
func (in *APIResourceSchemaSpec) DeepCopy() *APIResourceSchemaSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceSchemaSpec.
func (*APIResourceSchemaSpec) DeepCopyInto ¶
func (in *APIResourceSchemaSpec) DeepCopyInto(out *APIResourceSchemaSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIResourceVersion ¶
type APIResourceVersion struct {
// name is the version name, e.g. “v1”, “v2beta1”, etc.
// The custom resources are served under this version at `/apis/<group>/<version>/...` if `served` is true.
//
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=^v[1-9][0-9]*([a-z]+[1-9][0-9]*)?$
Name string `json:"name"`
// served is a flag enabling/disabling this version from being served via REST APIs
//
// +required
// +kubebuilder:default=true
Served bool `json:"served"`
// storage indicates this version should be used when persisting custom resources to storage.
// There must be exactly one version with storage=true.
//
// +required
Storage bool `json:"storage"`
// deprecated indicates this version of the custom resource API is deprecated.
// When set to true, API requests to this version receive a warning header in the server response.
// Defaults to false.
//
// +optional
Deprecated bool `json:"deprecated,omitempty"`
// deprecationWarning overrides the default warning returned to API clients.
// May only be set when `deprecated` is true.
// The default warning indicates this version is deprecated and recommends use
// of the newest served version of equal or greater stability, if one exists.
//
// +optional
DeprecationWarning *string `json:"deprecationWarning,omitempty"`
// schema describes the structural schema used for validation, pruning, and defaulting
// of this version of the custom resource.
//
// +required
// +kubebuilder:pruning:PreserveUnknownFields
// +structType=atomic
Schema runtime.RawExtension `json:"schema"`
// subresources specify what subresources this version of the defined custom resource have.
//
// +optional
Subresources *apiextensionsv1.CustomResourceSubresources `json:"subresources,omitempty"`
// additionalPrinterColumns specifies additional columns returned in Table output.
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details.
// If no columns are specified, a single column displaying the age of the custom resource is used.
//
// +optional
// +listType=map
// +listMapKey=name
AdditionalPrinterColumns []apiextensionsv1.CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty"`
}
APIResourceVersion describes one API version of a resource.
func (*APIResourceVersion) DeepCopy ¶
func (in *APIResourceVersion) DeepCopy() *APIResourceVersion
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceVersion.
func (*APIResourceVersion) DeepCopyInto ¶
func (in *APIResourceVersion) DeepCopyInto(out *APIResourceVersion)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BoundAPIResource ¶
type BoundAPIResource struct {
// group is the group of the bound API. Empty string for the core API group.
//
// +required
Group string `json:"group"`
// resource is the resource of the bound API.
//
// kubebuilder:validation:MinLength=1
// +required
Resource string `json:"resource"`
// Schema references the APIResourceSchema that is bound to this API.
//
// +required
Schema BoundAPIResourceSchema `json:"schema"`
// storageVersions lists all versions of a resource that were ever persisted. Tracking these
// versions allows a migration path for stored versions in etcd. The field is mutable
// so a migration controller can finish a migration to another version (ensuring
// no old objects are left in storage), and then remove the rest of the
// versions from this list.
//
// Versions may not be removed while they exist in this list.
//
// +optional
// +listType=set
StorageVersions []string `json:"storageVersions,omitempty"`
}
BoundAPIResource describes a bound GroupVersionResource through an APIResourceSchema of an APIExport..
func (*BoundAPIResource) DeepCopy ¶
func (in *BoundAPIResource) DeepCopy() *BoundAPIResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BoundAPIResource.
func (*BoundAPIResource) DeepCopyInto ¶
func (in *BoundAPIResource) DeepCopyInto(out *BoundAPIResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BoundAPIResourceSchema ¶
type BoundAPIResourceSchema struct {
// name is the bound APIResourceSchema name.
//
// +required
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// UID is the UID of the APIResourceSchema that is bound to this API.
//
// +required
// +kubebuilder:validation:MinLength=1
UID string `json:"UID"`
}
BoundAPIResourceSchema is a reference to an APIResourceSchema.
func (*BoundAPIResourceSchema) DeepCopy ¶
func (in *BoundAPIResourceSchema) DeepCopy() *BoundAPIResourceSchema
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BoundAPIResourceSchema.
func (*BoundAPIResourceSchema) DeepCopyInto ¶
func (in *BoundAPIResourceSchema) DeepCopyInto(out *BoundAPIResourceSchema)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExportReference ¶
type ExportReference struct {
// workspace is a reference to an APIExport in the same organization. The creator
// of the APIBinding needs to have access to the APIExport with the verb `bind`
// in order to bind to it.
//
// +optional
Workspace *WorkspaceExportReference `json:"workspace,omitempty"`
}
ExportReference describes a reference to an APIExport. Exactly one of the fields must be set.
func (*ExportReference) DeepCopy ¶
func (in *ExportReference) DeepCopy() *ExportReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportReference.
func (*ExportReference) DeepCopyInto ¶
func (in *ExportReference) DeepCopyInto(out *ExportReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkspaceExportReference ¶
type WorkspaceExportReference struct {
// name is a workspace name in the same organization.
//
// +required
// +kubebuilder:validation:Required
// +kube:validation:MinLength=1
// +kubebuilder:validation:Pattern:="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
WorkspaceName string `json:"name"`
// Name of the APIExport that describes the API.
//
// +required
// +kubebuilder:validation:Required
// +kube:validation:MinLength=1
ExportName string `json:"exportName"`
}
WorkspaceExportReference describes an API and backing implementation that are provided by an actor in the specified Workspace.
func (*WorkspaceExportReference) DeepCopy ¶
func (in *WorkspaceExportReference) DeepCopy() *WorkspaceExportReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceExportReference.
func (*WorkspaceExportReference) DeepCopyInto ¶
func (in *WorkspaceExportReference) DeepCopyInto(out *WorkspaceExportReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.