v1alpha1

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=cache.kcp.io +k8s:openapi-gen=true +k8s:openapi-model-package=com.github.kcp-dev.sdk.apis.cache.v1alpha1

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 (
	// CachedResourceInvalidReferenceReason is a reason for the CachedResourceValid condition that the referenced
	// CachedResource reference is invalid.
	CachedResourceInvalidReferenceReason = "CachedResourceInvalidReference"
	// CachedResourceNotFoundReason is a reason for the CachedResourceValid condition that the referenced CachedResource is not found.
	CachedResourceNotFoundReason = "CachedResourceNotFound"
	// ResourceNotClusterScoped is a reason for the CachedResourceValid condition
	// that the resource in CachedResource is not cluster scoped.
	ResourceNotClusterScoped = "ResourceNotClusterScoped"

	// InternalErrorReason is a reason used by multiple conditions that something went wrong.
	InternalErrorReason = "InternalError"
)
View Source
const (
	CachedResourceValidNoResources   = "NoResources"
	CachedResourceValidDeleting      = "Deleting"
	CachedResourceReplicationStarted = "Started"
)

These are valid reasons of published resource.

View Source
const (
	// PartitionValid is a condition for CachedResourceEndpointSlice that reflects the validity of the referenced Partition.
	PartitionValid conditionsv1alpha1.ConditionType = "PartitionValid"

	// EndpointURLsReady is a condition for CachedResourceEndpointSlice that reflects the readiness of the URLs.
	//
	// Deprecated: This condition is deprecated and will be removed in a future release.
	CachedResourceEndpointSliceURLsReady conditionsv1alpha1.ConditionType = "EndpointURLsReady"

	// PartitionInvalidReferenceReason is a reason for the PartitionValid condition of CachedResourceEndpointSlice that the
	// Partition reference is invalid.
	PartitionInvalidReferenceReason = "PartitionInvalidReference"
)

These are valid conditions of CachedResourceEndpointSlice in addition to CachedResourceValid and related reasons defined with the APIBinding type.

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.

func (CachedObject) OpenAPIModelName added in v0.31.0

func (in CachedObject) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedObjectList) OpenAPIModelName added in v0.31.0

func (in CachedObjectList) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedObjectSpec) OpenAPIModelName added in v0.31.0

func (in CachedObjectSpec) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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) OpenAPIModelName added in v0.31.0

func (in CachedResource) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedResourceEndpoint) OpenAPIModelName added in v0.31.0

func (in CachedResourceEndpoint) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (*CachedResourceEndpointSlice) GetConditions

func (CachedResourceEndpointSlice) OpenAPIModelName added in v0.31.0

func (in CachedResourceEndpointSlice) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

func (*CachedResourceEndpointSlice) SetConditions

func (in *CachedResourceEndpointSlice) SetConditions(conditions conditionsv1alpha1.Conditions)

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.

func (CachedResourceEndpointSliceList) OpenAPIModelName added in v0.31.0

func (in CachedResourceEndpointSliceList) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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"`

	// partition points to a partition that is used for filtering the endpoints
	// of the CachedResource part of the slice.
	//
	// +optional
	Partition string `json:"partition,omitempty"`
}

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.

func (CachedResourceEndpointSliceSpec) OpenAPIModelName added in v0.31.0

func (in CachedResourceEndpointSliceSpec) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

type CachedResourceEndpointSliceStatus

type CachedResourceEndpointSliceStatus struct {
	// conditions is a list of conditions that apply to the CachedResourceEndpointSlice.
	Conditions conditionsv1alpha1.Conditions `json:"conditions,omitempty"`

	// endpoints contains all the URLs of the Replication service.
	//
	// +optional
	// +listType=map
	// +listMapKey=url
	CachedResourceEndpoints []CachedResourceEndpoint `json:"endpoints,omitempty"`

	// shardSelector is the selector used to filter the shards. It is used to filter the shards
	// when determining partition scope when deriving the endpoints. This is set by owning shard,
	// and is used by follower shards to determine if its inscope or not.
	//
	// +optional
	ShardSelector string `json:"shardSelector,omitempty"`
}

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.

func (CachedResourceEndpointSliceStatus) OpenAPIModelName added in v0.31.0

func (in CachedResourceEndpointSliceStatus) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedResourceList) OpenAPIModelName added in v0.31.0

func (in CachedResourceList) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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 {
	// path is a logical cluster path where the CachedResource is defined. If empty,
	// the CachedResource is assumed to be co-located with the referencing resource.
	//
	// +optional
	// +kubebuilder:validation:Pattern:="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(:[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
	Path string `json:"path,omitempty"`

	// 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.

func (CachedResourceReference) OpenAPIModelName added in v0.31.0

func (in CachedResourceReference) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedResourceSpec) OpenAPIModelName added in v0.31.0

func (in CachedResourceSpec) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (CachedResourceStatus) OpenAPIModelName added in v0.31.0

func (in CachedResourceStatus) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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

func (GroupVersionResource) OpenAPIModelName added in v0.31.0

func (in GroupVersionResource) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (Identity) OpenAPIModelName added in v0.31.0

func (in Identity) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

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.

func (ResourceCount) OpenAPIModelName added in v0.31.0

func (in ResourceCount) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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