v1alpha1

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=cache.kcp.io +k8s:openapi-gen=true

Index

Constants

View Source
const (
	// CachedResourceValid represents status of the scheduling process for this published resource.
	CachedResourceValid conditionsv1alpha1.ConditionType = "ResourceValid"

	// ReplicationStarted represents status of the replication process for this published resource.
	ReplicationStarted conditionsv1alpha1.ConditionType = "ReplicationStarted"
)

These are valid conditions of published resource.

View Source
const (
	// CachedResourceIdentityValid represents status of the identity generation process for this published resource.
	CachedResourceIdentityValid conditionsv1alpha1.ConditionType = "IdentityValid"

	IdentityGenerationFailedReason   = "IdentityGenerationFailed"
	IdentityVerificationFailedReason = "IdentityVerificationFailed"
)
View Source
const (
	CachedResourceValidNoResources   = "NoResources"
	CachedResourceValidDeleting      = "Deleting"
	CachedResourceReplicationStarted = "Started"
)

These are valid reasons of published resource.

View Source
const (
	// CachedResourceEndpointSliceSkipAnnotation is an annotation that can be set on a CachedResource to skip the creation of default CachedResourceEndpointSlice.
	CachedResourceEndpointSliceSkipAnnotation = "cachedresources.cache.kcp.io/skip-endpointslice"
)
View Source
const CachedResourceFinalizer = "cachedresource.cache.kcp.dev"

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: cache.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects.

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

Types

type CachedObject

type CachedObject struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec CachedObjectSpec `json:"spec"`
}

CachedObject defines a resource that is cached in the cache.

+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:storageversion +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*CachedObject) DeepCopy

func (in *CachedObject) DeepCopy() *CachedObject

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedObject.

func (*CachedObject) DeepCopyInto

func (in *CachedObject) DeepCopyInto(out *CachedObject)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedObject) DeepCopyObject

func (in *CachedObject) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CachedObjectList

type CachedObjectList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CachedObject `json:"items"`
}

CachedObjectList contains a list of CachedObject

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*CachedObjectList) DeepCopy

func (in *CachedObjectList) DeepCopy() *CachedObjectList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedObjectList.

func (*CachedObjectList) DeepCopyInto

func (in *CachedObjectList) DeepCopyInto(out *CachedObjectList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedObjectList) DeepCopyObject

func (in *CachedObjectList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CachedObjectSpec

type CachedObjectSpec struct {
	Raw runtime.RawExtension `json:"raw"`
}

CachedObjectSpec defines the desired state of CachedObject.

func (*CachedObjectSpec) DeepCopy

func (in *CachedObjectSpec) DeepCopy() *CachedObjectSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedObjectSpec.

func (*CachedObjectSpec) DeepCopyInto

func (in *CachedObjectSpec) DeepCopyInto(out *CachedObjectSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResource

type CachedResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CachedResourceSpec   `json:"spec"`
	Status CachedResourceStatus `json:"status,omitempty"`
}

CachedResource defines a resource that should be published to other workspaces

+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:storageversion +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp +kubebuilder:printcolumn:name="Resource",type=string,JSONPath=`.spec.resource`,description="Resource type being published" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*CachedResource) DeepCopy

func (in *CachedResource) DeepCopy() *CachedResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResource.

func (*CachedResource) DeepCopyInto

func (in *CachedResource) DeepCopyInto(out *CachedResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedResource) DeepCopyObject

func (in *CachedResource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*CachedResource) GetConditions

func (in *CachedResource) GetConditions() conditionsv1alpha1.Conditions

func (*CachedResource) SetConditions

func (in *CachedResource) SetConditions(c conditionsv1alpha1.Conditions)

type CachedResourceEndpoint

type CachedResourceEndpoint struct {
	// url is an CachedResource virtual workspace URL.
	//
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:format:URL
	// +required
	URL string `json:"url"`
}

CachedResourceEndpoint contains the endpoint information of a Replication service for a specific shard.

func (*CachedResourceEndpoint) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceEndpoint.

func (*CachedResourceEndpoint) DeepCopyInto

func (in *CachedResourceEndpoint) DeepCopyInto(out *CachedResourceEndpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResourceEndpointSlice

type CachedResourceEndpointSlice struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec holds the desired state:
	// - the targeted CachedResource
	Spec CachedResourceEndpointSliceSpec `json:"spec,omitempty"`

	// status communicates the observed state:
	// the filtered list of endpoints for the Replication service.
	// +optional
	Status CachedResourceEndpointSliceStatus `json:"status,omitempty"`
}

CachedResourceEndpointSlice is a sink for the endpoints of CachedResource virtual workspaces.

func (*CachedResourceEndpointSlice) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceEndpointSlice.

func (*CachedResourceEndpointSlice) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedResourceEndpointSlice) DeepCopyObject

func (in *CachedResourceEndpointSlice) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CachedResourceEndpointSliceList

type CachedResourceEndpointSliceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []CachedResourceEndpointSlice `json:"items"`
}

CachedResourceEndpointSliceList is a list of CachedResourceEndpointSlice resources.

func (*CachedResourceEndpointSliceList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceEndpointSliceList.

func (*CachedResourceEndpointSliceList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedResourceEndpointSliceList) DeepCopyObject

func (in *CachedResourceEndpointSliceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CachedResourceEndpointSliceSpec

type CachedResourceEndpointSliceSpec struct {
	// CachedResource points to the real CachedResource the slice is created for.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="CachedResource reference must not be changed"
	CachedResource CachedResourceReference `json:"cachedResource"`
}

CachedResourceEndpointSliceSpec defines the desired state of the CachedResourceEndpointSlice.

func (*CachedResourceEndpointSliceSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceEndpointSliceSpec.

func (*CachedResourceEndpointSliceSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResourceEndpointSliceStatus

type CachedResourceEndpointSliceStatus struct {
	// endpoints contains all the URLs of the Replication service.
	//
	// +optional
	// +listType=map
	// +listMapKey=url
	CachedResourceEndpoints []CachedResourceEndpoint `json:"endpoints"`
}

CachedResourceEndpointSliceStatus defines the observed state of CachedResourceEndpointSlice.

func (*CachedResourceEndpointSliceStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceEndpointSliceStatus.

func (*CachedResourceEndpointSliceStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResourceList

type CachedResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CachedResource `json:"items"`
}

CachedResourceList contains a list of CachedResource

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*CachedResourceList) DeepCopy

func (in *CachedResourceList) DeepCopy() *CachedResourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceList.

func (*CachedResourceList) DeepCopyInto

func (in *CachedResourceList) DeepCopyInto(out *CachedResourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CachedResourceList) DeepCopyObject

func (in *CachedResourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CachedResourcePhaseType

type CachedResourcePhaseType string

CachedResourcePhaseType is the type of the current phase of the published resource.

+kubebuilder:validation:Enum=Scheduling;Initializing;Ready;Deleting;Deleted

const (
	CachedResourcePhaseInitializing CachedResourcePhaseType = "Initializing"
	CachedResourcePhaseReady        CachedResourcePhaseType = "Ready"
	CachedResourcePhaseDeleting     CachedResourcePhaseType = "Deleting"
	CachedResourcePhaseDeleted      CachedResourcePhaseType = "Deleted"
)

type CachedResourceReference

type CachedResourceReference struct {
	// name is the name of the CachedResource the reference points to.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kube:validation:MinLength=1
	Name string `json:"name"`
}

CachedResourceReference is a reference to a CachedResource.

func (*CachedResourceReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceReference.

func (*CachedResourceReference) DeepCopyInto

func (in *CachedResourceReference) DeepCopyInto(out *CachedResourceReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResourceSpec

type CachedResourceSpec struct {
	// GroupVersionResource is the fully qualified name of the resource to be published.
	GroupVersionResource `json:",inline"`

	// identity points to a secret that contains the API identity in the 'key' file.
	// The API identity allows access to CachedResource's resources via the APIExport.
	//
	// Different  CachedResource in a workspace can share a common identity, or have different
	// ones. The identity (the secret) can also be transferred to another workspace
	// when the  ublishedResource is moved.
	//
	// The identity is defaulted. A secret with the name of the CachedResource is automatically
	// created.
	//
	// +optional
	Identity *Identity `json:"identity,omitempty"`

	// LabelSelector is used to filter which resources should be published
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

CachedResourceSpec defines the desired state of CachedResource.

func (*CachedResourceSpec) DeepCopy

func (in *CachedResourceSpec) DeepCopy() *CachedResourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceSpec.

func (*CachedResourceSpec) DeepCopyInto

func (in *CachedResourceSpec) DeepCopyInto(out *CachedResourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CachedResourceStatus

type CachedResourceStatus struct {
	// IdentityHash is a hash of the identity configuration
	// +optional
	IdentityHash string `json:"identityHash,omitempty"`

	// ResourceCount is the number of resources that match the label selector
	// +optional
	ResourceCounts *ResourceCount `json:"resourceCounts,omitempty"`

	// Phase of the workspace (Initializing, Ready, Unavailable).
	//
	// +kubebuilder:default=Initializing
	Phase CachedResourcePhaseType `json:"phase,omitempty"`

	// Current processing state of the Workspace.
	// +optional
	Conditions conditionsv1alpha1.Conditions `json:"conditions,omitempty"`
}

CachedResourceStatus defines the observed state of CachedResource.

func (*CachedResourceStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CachedResourceStatus.

func (*CachedResourceStatus) DeepCopyInto

func (in *CachedResourceStatus) DeepCopyInto(out *CachedResourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GroupVersionResource

type GroupVersionResource struct {
	// group is the name of an API group.
	// For core groups this is the empty string '""'.
	//
	// +kubebuilder:validation:Pattern=`^(|[a-z0-9]([-a-z0-9]*[a-z0-9](\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?)$`
	// +optional
	Group string `json:"group,omitempty"`

	// version is the version of the resource.
	// +optional
	Version string `json:"version,omitempty"`

	// resource is the name of the resource.
	// Note: it is worth noting that you can not ask for permissions for resource provided by a CRD
	// not provided by an api export.
	// +kubebuilder:validation:Pattern=`^[a-z][-a-z0-9]*[a-z0-9]$`
	// +required
	// +kubebuilder:validation:Required
	Resource string `json:"resource"`
}

GroupVersionResource identifies a resource.

func (*GroupVersionResource) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupVersionResource.

func (*GroupVersionResource) DeepCopyInto

func (in *GroupVersionResource) DeepCopyInto(out *GroupVersionResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (GroupVersionResource) GetGroup

func (in GroupVersionResource) GetGroup() string

func (GroupVersionResource) GetResource

func (in GroupVersionResource) GetResource() string

type Identity

type Identity struct {
	// secretRef is a reference to a secret that contains the API identity in the 'key' file.
	//
	// +optional
	SecretRef *corev1.SecretReference `json:"secretRef,omitempty"`
}

Identity defines the identity of an CachedResource, i.e. determines the cached resource access of the resources, that are published by this CachedResource.

func (*Identity) DeepCopy

func (in *Identity) DeepCopy() *Identity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity.

func (*Identity) DeepCopyInto

func (in *Identity) DeepCopyInto(out *Identity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceCount

type ResourceCount struct {
	Cache int `json:"cache"`
	Local int `json:"local"`
}

ResourceCount is the number of resources that match the label selector and are cached in the cache.

func (*ResourceCount) DeepCopy

func (in *ResourceCount) DeepCopy() *ResourceCount

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceCount.

func (*ResourceCount) DeepCopyInto

func (in *ResourceCount) DeepCopyInto(out *ResourceCount)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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