v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 5 Imported by: 2 modules, 0 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

+groupName=syncagent.kcp.io +versionName=v1alpha1 +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	// Deprecated: Use Go templates instead.
	PlaceholderRemoteClusterName = "$remoteClusterName"
	// Deprecated: Use Go templates instead.
	PlaceholderRemoteNamespace = "$remoteNamespace"
	// Deprecated: Use Go templates instead.
	PlaceholderRemoteNamespaceHash = "$remoteNamespaceHash"
	// Deprecated: Use Go templates instead.
	PlaceholderRemoteName = "$remoteName"
	// Deprecated: Use Go templates instead.
	PlaceholderRemoteNameHash = "$remoteNameHash"
)
View Source
const (
	// AgentNameAnnotation records which Sync Agent has created an APIResourceSchema.
	AgentNameAnnotation = "syncagent.kcp.io/agent-name"

	// AgentNameLabel records which Sync Agent has created an APIResourceSchema.
	AgentNameLabel = "syncagent.kcp.io/agent-name"

	// SourceGenerationAnnotation is the annotation on APIResourceSchemas that tells us
	// what generation of the CRD it was based on. This can be helpful in debugging,
	// as ARS resources cannot be updated, i.e. changes to CRDs are not reflected in ARS.
	SourceGenerationAnnotation = "syncagent.kcp.io/source-generation"
)
View Source
const GroupName = "syncagent.kcp.io"

GroupName is the group name use in this package.

View Source
const GroupVersion = "v1alpha1"

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme

	// SchemeGroupVersion is group version used to register these objects.
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion}
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

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

Types

type PublishedResource

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

	Spec PublishedResourceSpec `json:"spec"`

	// Status contains reconciliation information for the published resource.
	Status PublishedResourceStatus `json:"status,omitempty"`
}

PublishedResource describes how an API type (usually defined by a CRD) on the service cluster should be exposed in kcp workspaces. Besides controlling how namespaced and cluster-wide resources should be mapped, the GVK can also be transformed to provide a uniform, implementation-independent access to the APIs inside kcp.

func (*PublishedResource) DeepCopy

func (in *PublishedResource) DeepCopy() *PublishedResource

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

func (*PublishedResource) DeepCopyInto

func (in *PublishedResource) DeepCopyInto(out *PublishedResource)

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

func (*PublishedResource) DeepCopyObject

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

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

type PublishedResourceList

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

PublishedResourceList contains a list of PublishedResources.

func (*PublishedResourceList) DeepCopy

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

func (*PublishedResourceList) DeepCopyInto

func (in *PublishedResourceList) DeepCopyInto(out *PublishedResourceList)

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

func (*PublishedResourceList) DeepCopyObject

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

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

type PublishedResourceSpec

type PublishedResourceSpec struct {
	// Describes the "source" Resource that exists on this, the service cluster,
	// that should be exposed in kcp workspaces. All fields have to be specified.
	Resource SourceResourceDescriptor `json:"resource"`

	// If specified, the filter will be applied to the resources in a workspace
	// and allow restricting which of them will be handled by the Sync Agent.
	Filter *ResourceFilter `json:"filter,omitempty"`

	// Naming can be used to control how the namespace and names for local objects
	// are formed. If not specified, the Sync Agent will use defensive defaults to
	// prevent naming collisions in the service cluster.
	// When configuring this, great care must be taken to not allow for naming
	// collisions to happen; keep in mind that the same name/namespace can exists in
	// many different kcp workspaces.
	Naming *ResourceNaming `json:"naming,omitempty"`

	// EnableWorkspacePaths toggles whether the Sync Agent will not just store the kcp
	// cluster name as a label on each locally synced object, but also the full workspace
	// path. This is optional because it requires additional requests to kcp and
	// should only be used if the workspace path is of interest on the
	// service cluster side.
	EnableWorkspacePaths bool `json:"enableWorkspacePaths,omitempty"`

	// Projection is used to change the GVK of a published resource within kcp.
	// This can be used to hide implementation details and provide a customized API
	// experience to the user.
	// All fields in the projection are optional. If a field is set, it will overwrite
	// that field in the GVK. The namespaced field can be set to turn a cluster-wide
	// resource namespaced or vice-versa.
	Projection *ResourceProjection `json:"projection,omitempty"`

	// Mutation allows to configure "rewrite rules" to modify the objects in both
	// directions during the synchronization.
	Mutation *ResourceMutationSpec `json:"mutation,omitempty"`

	// Related configures additional resources that semantically belong to the synced
	// resource, like a Secret containing generated credentials. Related objects are
	// synced along the main resource.
	Related []RelatedResourceSpec `json:"related,omitempty"`

	// Synchronization allows to configure how the syncagent processes this resource.
	Synchronization *SynchronizationSpec `json:"synchronization,omitempty"`
}

PublishedResourceSpec describes the desired resource publication from a service cluster to kcp.

func (*PublishedResourceSpec) DeepCopy

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

func (*PublishedResourceSpec) DeepCopyInto

func (in *PublishedResourceSpec) DeepCopyInto(out *PublishedResourceSpec)

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

type PublishedResourceStatus

type PublishedResourceStatus struct {
	ResourceSchemaName string `json:"resourceSchemaName,omitempty"`
}

PublishedResourceStatus stores status information about a published resource.

func (*PublishedResourceStatus) DeepCopy

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

func (*PublishedResourceStatus) DeepCopyInto

func (in *PublishedResourceStatus) DeepCopyInto(out *PublishedResourceStatus)

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

type RegularExpression

type RegularExpression struct {
	// Pattern can be left empty to simply replace the entire value with the
	// replacement.
	Pattern string `json:"pattern,omitempty"`
	// Replacement is the string that the matched pattern is replaced with. It
	// can contain references to groups in the pattern by using \N.
	Replacement string `json:"replacement,omitempty"`
}

RegularExpression models a Go regular expression string replacement. See https://pkg.go.dev/regexp/syntax for more information on the syntax.

func (*RegularExpression) DeepCopy

func (in *RegularExpression) DeepCopy() *RegularExpression

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

func (*RegularExpression) DeepCopyInto

func (in *RegularExpression) DeepCopyInto(out *RegularExpression)

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

type RelatedResourceCleanupPolicy added in v0.8.0

type RelatedResourceCleanupPolicy string

RelatedResourceCleanupPolicy controls when the syncagent deletes the destination copies of a related resource. The original object on the origin side is never deleted, regardless of the chosen policy.

+kubebuilder:validation:Enum=Orphan;OnPrimaryDeletion;MatchOrigin

const (
	// RelatedResourceCleanupPolicyOrphan never deletes copies (default; == legacy cleanup:false).
	RelatedResourceCleanupPolicyOrphan RelatedResourceCleanupPolicy = "Orphan"
	// RelatedResourceCleanupPolicyOnPrimaryDeletion deletes copies only when the primary object
	// is deleted (== legacy cleanup:true).
	RelatedResourceCleanupPolicyOnPrimaryDeletion RelatedResourceCleanupPolicy = "OnPrimaryDeletion"
	// RelatedResourceCleanupPolicyMatchOrigin keeps the destination set equal to the origin set:
	// a copy is pruned as soon as its origin object is gone, and all copies are deleted when the
	// primary object is deleted.
	RelatedResourceCleanupPolicyMatchOrigin RelatedResourceCleanupPolicy = "MatchOrigin"
)

type RelatedResourceObject

type RelatedResourceObject struct {
	RelatedResourceObjectSpec `json:",inline"`

	// Namespace configures in what namespace the related object resides in. If
	// not specified, the same namespace as the main object is assumed. If the
	// main object is cluster-scoped, this field is required and an error will be
	// raised during syncing if the field is not specified.
	Namespace *RelatedResourceObjectSpec `json:"namespace,omitempty"`
}

RelatedResourceSource configures how the related resource can be found on the origin side and where it is to supposed to be created on the destination side.

func (*RelatedResourceObject) DeepCopy

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

func (*RelatedResourceObject) DeepCopyInto

func (in *RelatedResourceObject) DeepCopyInto(out *RelatedResourceObject)

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

type RelatedResourceObjectReference

type RelatedResourceObjectReference struct {
	// Path is a simplified JSONPath expression like "metadata.name". A reference
	// must always select at least _something_ in the object, even if the value
	// is discarded by the regular expression.
	Path string `json:"path"`
	// Regex is a Go regular expression that is optionally applied to the selected
	// value from the path.
	Regex *RegularExpression `json:"regex,omitempty"`
}

RelatedResourceObjectReference describes a path expression that is evaluated inside a JSON-marshalled Kubernetes object, yielding a string when evaluated.

func (*RelatedResourceObjectReference) DeepCopy

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

func (*RelatedResourceObjectReference) DeepCopyInto

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

type RelatedResourceObjectSelector

type RelatedResourceObjectSelector struct {
	metav1.LabelSelector `json:",inline"`

	Rewrite RelatedResourceSelectorRewrite `json:"rewrite"`
}

RelatedResourceObjectSelector describes how to locate a related object based on labels. This is useful if the main resource has no and cannot construct a reference to the related object because its name/namespace might be randomized.

func (*RelatedResourceObjectSelector) DeepCopy

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

func (*RelatedResourceObjectSelector) DeepCopyInto

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

type RelatedResourceObjectSpec

type RelatedResourceObjectSpec struct {
	// Selector is a label selector that is useful if no reference is in the
	// main resource (i.e. if the related object links back to its parent, instead
	// of the parent pointing to the related object).
	Selector *RelatedResourceObjectSelector `json:"selector,omitempty"`
	// Reference points to a field inside the main object. This reference is
	// evaluated on both source and destination sides to find the related object.
	Reference *RelatedResourceObjectReference `json:"reference,omitempty"`
	// Template is a Go templated string that can make use of variables to
	// construct the resulting string.
	Template *TemplateExpression `json:"template,omitempty"`
}

RelatedResourceObjectSpec configures different ways an object can be located. All fields are mutually exclusive.

func (*RelatedResourceObjectSpec) DeepCopy

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

func (*RelatedResourceObjectSpec) DeepCopyInto

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

type RelatedResourceOrigin

type RelatedResourceOrigin string
const (
	RelatedResourceOriginService RelatedResourceOrigin = "service"
	RelatedResourceOriginKcp     RelatedResourceOrigin = "kcp"
)

type RelatedResourceProjection added in v0.5.0

type RelatedResourceProjection struct {
	// The API group, for example "myservice.example.com". Leave empty to not modify the API group.
	Group string `json:"group,omitempty"`
	// The API version, for example "v1beta1". Leave empty to not modify the version.
	Version string `json:"version,omitempty"`
	// The resource name, for example "databases". Leave empty to not modify the resource.
	Resource string `json:"resource,omitempty"`
}

RelatedResourceProjection describes how the source GVK of a related resource (i.e. the GVK on the related resource's origin side) should be modified when an object is copied from the origin to the destination.

func (*RelatedResourceProjection) DeepCopy added in v0.5.0

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

func (*RelatedResourceProjection) DeepCopyInto added in v0.5.0

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

type RelatedResourceSelectorRewrite

type RelatedResourceSelectorRewrite struct {
	// Regex is a Go regular expression that is optionally applied to the selected
	// value from the path.
	Regex    *RegularExpression  `json:"regex,omitempty"`
	Template *TemplateExpression `json:"template,omitempty"`
}

func (*RelatedResourceSelectorRewrite) DeepCopy

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

func (*RelatedResourceSelectorRewrite) DeepCopyInto

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

type RelatedResourceSpec

type RelatedResourceSpec struct {
	// Identifier is a unique name for this related resource. The name must be unique within one
	// PublishedResource and is the key by which consumers (end users) can identify and consume the
	// related resource. Common names are "connection-details" or "credentials".
	//
	// The identifier is used verbatim as a label value on the synced copies of the related resource,
	// so it must be a valid label value: a lowercase RFC 1123 label consisting of lowercase
	// alphanumeric characters or '-', starting and ending with an alphanumeric character, and at
	// most 63 characters long.
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	Identifier string `json:"identifier"`

	// +kubebuilder:validation:Enum=service;kcp
	Origin RelatedResourceOrigin `json:"origin"`

	// Group is the API group of the related resource. This should be left blank for resources
	// in the core API group.
	Group string `json:"group,omitempty"`

	// Version is the API version of the related resource. This can be left blank to automatically
	// use the preferred version.
	Version string `json:"version,omitempty"`

	// Resource is the name of the related resource (for example "secrets").
	Resource string `json:"resource,omitempty"`

	// Kind is the object kind of the related resource (for example "Secret").
	//
	// Deprecated: Use "Resource" instead. This field is limited to "ConfigMap" and "Secret" and will
	// be removed in the future. Kind and Resource cannot be specified at the same time.
	//
	// +kubebuilder:validation:Enum=ConfigMap;Secret
	Kind string `json:"kind,omitempty"`

	// IdentityHash is the identity hash of a kcp APIExport, in case the given Kind is
	// provided by an APIExport and not Kube-native.
	IdentityHash string `json:"identityHash,omitempty"`

	// Cleanup can be set to true to make the syncagent delete any copy of this related resource on
	// the destination side (i.e. the original related object will not be touched, regardless of this
	// option). Leaving this disabled, the syncagent will only create copies of the related objects,
	// but never delete them itself.
	//
	// Deprecated: use CleanupPolicy instead. When CleanupPolicy is empty, cleanup:true is treated
	// as OnPrimaryDeletion and cleanup:false as Orphan.
	Cleanup bool `json:"cleanup,omitempty"`

	// CleanupPolicy controls when the syncagent deletes destination copies of this related
	// resource. The original object on the origin side is never deleted.
	//
	//   - Orphan (default): copies are never deleted by the agent.
	//   - OnPrimaryDeletion: copies are deleted only when the primary object is deleted.
	//   - MatchOrigin: copies are pruned as soon as their origin object no longer exists, and
	//     all copies are deleted when the primary object is deleted.
	//
	// When left empty, the deprecated Cleanup field is used to derive the effective policy.
	//
	// +optional
	CleanupPolicy RelatedResourceCleanupPolicy `json:"cleanupPolicy,omitempty"`

	// Projection is used to change the GVK of a related resource on the opposite side of
	// its origin.
	// All fields in the projection are optional. If a field is set, it will overwrite
	// that field in the GVK.
	Projection *RelatedResourceProjection `json:"projection,omitempty"`

	// Object describes how the related resource can be found on the origin side
	// and where it is to supposed to be created on the destination side.
	Object RelatedResourceObject `json:"object"`

	// Mutation configures optional transformation rules for the related resource.
	// Status mutations are only performed when the related resource originates in kcp.
	Mutation *ResourceMutationSpec `json:"mutation,omitempty"`

	// Watch configures how the agent identifies the owning primary object when a related
	// resource changes. When configured, the agent watches the origin side and, if status
	// synchronization is enabled, the side selected by SyncStatusOrigin. Without this field,
	// changes to related resources do not trigger reconciliation.
	Watch *RelatedResourceWatch `json:"watch,omitempty"`

	// SyncStatus enables synchronization of the status subresource. By default, status is synced
	// in the same direction as the spec (from Origin to the opposite side). SyncStatusOrigin can
	// select a different origin for status without changing the direction of spec synchronization.
	// The agent uses the status subresource endpoint to update the receiving object's status.
	// Both representations of the related resource must have a status subresource configured.
	//
	// Watch is required unless Origin and the effective SyncStatusOrigin are both kcp.
	//
	// +optional
	SyncStatus bool `json:"syncStatus,omitempty"`

	// SyncStatusOrigin selects the side from which status is synchronized when SyncStatus is true.
	// When omitted, it defaults to Origin, preserving the existing SyncStatus behavior.
	//
	//   - kcp: status is synced from kcp to the service cluster
	//   - service: status is synced from the service cluster to kcp
	//
	// This field requires SyncStatus to be true. Watch must be configured unless both Origin
	// and SyncStatusOrigin are kcp, so status changes trigger reconciliation and the required
	// informer caches are populated.
	//
	// +kubebuilder:validation:Enum=service;kcp
	// +optional
	SyncStatusOrigin RelatedResourceOrigin `json:"syncStatusOrigin,omitempty"`
}

RelatedResourceSpec describes a single related resource, which might point to any number of actual Kubernetes objects.

(in the following rule, group is optional becaue core/v1 is represented by group="") +kubebuilder:validation:XValidation:rule="has(self.kind) != (has(self.version) || has(self.resource))",message="must specify either kind (deprecated) or group, version, resource" +kubebuilder:validation:XValidation:rule="has(self.resource) == has(self.version)",message="resource and version must be configured together or not at all" +kubebuilder:validation:XValidation:rule="!has(self.group) || (has(self.resource) && has(self.version))",message="configuring a group also requires a version and resource" group is included here because when an identityHash is used, core/v1 cannot possibly be targeted +kubebuilder:validation:XValidation:rule="!has(self.identityHash) || (has(self.group) && has(self.version) && has(self.resource))",message="identity hashes can only be used with GVRs" +kubebuilder:validation:XValidation:rule="!has(self.syncStatusOrigin) || (has(self.syncStatus) && self.syncStatus)",message="syncStatus must be true when syncStatusOrigin is configured" +kubebuilder:validation:XValidation:rule="!has(self.syncStatus) || !self.syncStatus || (self.origin == 'kcp' && (!has(self.syncStatusOrigin) || self.syncStatusOrigin == 'kcp')) || has(self.watch)",message="watch must be configured when status synchronization involves the service side as an origin" +kubebuilder:validation:XValidation:rule="!(has(self.cleanupPolicy) && self.cleanupPolicy == 'MatchOrigin' && self.origin == 'service') || has(self.watch)",message="watch must be configured when cleanupPolicy is MatchOrigin and origin is service" +kubebuilder:validation:XValidation:rule="!(has(self.cleanup) && self.cleanup && has(self.cleanupPolicy) && self.cleanupPolicy == 'Orphan')",message="cleanup:true conflicts with cleanupPolicy: Orphan"

func (*RelatedResourceSpec) DeepCopy

func (in *RelatedResourceSpec) DeepCopy() *RelatedResourceSpec

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

func (*RelatedResourceSpec) DeepCopyInto

func (in *RelatedResourceSpec) DeepCopyInto(out *RelatedResourceSpec)

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

func (*RelatedResourceSpec) EffectiveCleanupPolicy added in v0.8.0

func (r *RelatedResourceSpec) EffectiveCleanupPolicy() RelatedResourceCleanupPolicy

EffectiveCleanupPolicy normalizes the deprecated Cleanup bool and the CleanupPolicy field into a single effective policy. CleanupPolicy takes precedence; when it is empty, cleanup:true maps to OnPrimaryDeletion and cleanup:false to Orphan.

func (*RelatedResourceSpec) EffectiveSyncStatusOrigin added in v0.9.0

func (r *RelatedResourceSpec) EffectiveSyncStatusOrigin() RelatedResourceOrigin

EffectiveSyncStatusOrigin returns the configured status origin, defaulting to the spec origin. It only selects a direction; SyncStatus still controls whether status is synchronized.

type RelatedResourceWatch added in v0.6.0

type RelatedResourceWatch struct {
	// ByOwner configures the watch handler to inspect the OwnerReferences of the changed
	// object. When an OwnerReference with the given Kind is found, the referenced owner
	// is enqueued as the primary object.
	// +optional
	ByOwner *RelatedResourceWatchByOwner `json:"byOwner,omitempty"`

	// BySelector configures the watch handler to list primary objects matching the given label
	// selector. When a related object changes, all primary objects matching this selector
	// are enqueued for reconciliation.
	// +optional
	BySelector *metav1.LabelSelector `json:"bySelector,omitempty"`
}

RelatedResourceWatch configures how the watch handler maps a changed related resource back to its owning primary object. Exactly one of ByOwner or BySelector must be set. +kubebuilder:validation:XValidation:rule="has(self.byOwner) != has(self.bySelector)",message="exactly one of byOwner or bySelector must be set"

func (*RelatedResourceWatch) DeepCopy added in v0.6.0

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

func (*RelatedResourceWatch) DeepCopyInto added in v0.6.0

func (in *RelatedResourceWatch) DeepCopyInto(out *RelatedResourceWatch)

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

type RelatedResourceWatchByOwner added in v0.6.0

type RelatedResourceWatchByOwner struct{}

RelatedResourceWatchByOwner configures reverse lookup via OwnerReferences. The agent already knows the GVK of the primary object, so no further configuration is needed: when a related object changes, its OwnerReferences are inspected for a reference whose Kind matches the primary object's Kind.

func (*RelatedResourceWatchByOwner) DeepCopy added in v0.6.0

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

func (*RelatedResourceWatchByOwner) DeepCopyInto added in v0.6.0

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

type ResourceCELMutation added in v0.5.0

type ResourceCELMutation struct {
	Path       string `json:"path"`
	Expression string `json:"expression"`
}

func (*ResourceCELMutation) DeepCopy added in v0.5.0

func (in *ResourceCELMutation) DeepCopy() *ResourceCELMutation

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

func (*ResourceCELMutation) DeepCopyInto added in v0.5.0

func (in *ResourceCELMutation) DeepCopyInto(out *ResourceCELMutation)

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

type ResourceDeleteMutation

type ResourceDeleteMutation struct {
	Path string `json:"path"`
}

func (*ResourceDeleteMutation) DeepCopy

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

func (*ResourceDeleteMutation) DeepCopyInto

func (in *ResourceDeleteMutation) DeepCopyInto(out *ResourceDeleteMutation)

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

type ResourceFilter

type ResourceFilter struct {
	// When given, the namespace filter will be applied to a resource's namespace.
	Namespace *metav1.LabelSelector `json:"namespace,omitempty"`
	// When given, the resource filter will be applied to a resource itself.
	Resource *metav1.LabelSelector `json:"resource,omitempty"`
}

ResourceFilter can be used to limit what resources should be included in an operation.

func (*ResourceFilter) DeepCopy

func (in *ResourceFilter) DeepCopy() *ResourceFilter

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

func (*ResourceFilter) DeepCopyInto

func (in *ResourceFilter) DeepCopyInto(out *ResourceFilter)

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

type ResourceMutation

type ResourceMutation struct {
	Delete   *ResourceDeleteMutation   `json:"delete,omitempty"`
	Regex    *ResourceRegexMutation    `json:"regex,omitempty"`
	Template *ResourceTemplateMutation `json:"template,omitempty"`
	CEL      *ResourceCELMutation      `json:"cel,omitempty"`
}

func (*ResourceMutation) DeepCopy

func (in *ResourceMutation) DeepCopy() *ResourceMutation

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

func (*ResourceMutation) DeepCopyInto

func (in *ResourceMutation) DeepCopyInto(out *ResourceMutation)

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

type ResourceMutationSpec

type ResourceMutationSpec struct {
	Spec   []ResourceMutation `json:"spec,omitempty"`
	Status []ResourceMutation `json:"status,omitempty"`
}

ResourceMutationSpec allows to configure "rewrite rules" to modify the objects in both directions during the synchronization.

func (*ResourceMutationSpec) DeepCopy

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

func (*ResourceMutationSpec) DeepCopyInto

func (in *ResourceMutationSpec) DeepCopyInto(out *ResourceMutationSpec)

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

type ResourceNaming

type ResourceNaming struct {
	// The name field allows to control the name the local objects created by the Sync Agent.
	// If left empty, the default value is:
	//
	//   "{{ .Object.metadata.namespace | sha3short }}-{{ .Object.metadata.name | sha3short }}"
	//
	// This guarantees unique names as long as the cluster name is used for the local namespace
	// (the default unless configured otherwise).
	//
	// For cluster-scoped objects, which have no namespace, the default value is:
	//
	//   "{{ .ClusterName | sha3short }}-{{ .Object.metadata.name | sha3short }}"
	//
	// This value is a Go template, see the documentation for the available variables and functions.
	//
	// Alternatively (but deprecated), this value can be a simple string using one of the following
	// placeholders:
	//
	//   - $remoteClusterName   -- the kcp workspace's cluster name (e.g. "1084s8ceexsehjm2")
	//   - $remoteNamespace     -- the original namespace used by the consumer inside the kcp
	//                             workspace (if targetNamespace is left empty, it's equivalent
	//                             to setting "$remote_ns")
	//   - $remoteNamespaceHash -- first 20 hex characters of the SHA-1 hash of $remoteNamespace
	//   - $remoteName          -- the original name of the object inside the kcp workspace
	//                             (rarely used to construct local namespace names)
	//   - $remoteNameHash      -- first 20 hex characters of the SHA-1 hash of $remoteName
	//
	// Authors are advised to use Go templates instead, as the custom variable syntax is deprecated
	// and will be removed from a future release of the Sync Agent.
	Name string `json:"name,omitempty"`

	// For namespaced resources, the this field allows to control where the local objects will
	// be created. If left empty, "{{ .ClusterName }}" is assumed.
	//
	// This value is a Go template, see the documentation for the available variables and functions.
	//
	// Alternatively (but deprecated), this value can be a simple string using one of the following
	// placeholders:
	//
	//   - $remoteClusterName   -- the kcp workspace's cluster name (e.g. "1084s8ceexsehjm2")
	//   - $remoteNamespace     -- the original namespace used by the consumer inside the kcp
	//                             workspace (if targetNamespace is left empty, it's equivalent
	//                             to setting "$remote_ns")
	//   - $remoteNamespaceHash -- first 20 hex characters of the SHA-1 hash of $remoteNamespace
	//   - $remoteName          -- the original name of the object inside the kcp workspace
	//                             (rarely used to construct local namespace names)
	//   - $remoteNameHash      -- first 20 hex characters of the SHA-1 hash of $remoteName
	//
	// Authors are advised to use Go templates instead, as the custom variable syntax is deprecated
	// and will be removed from a future release of the Sync Agent.
	Namespace string `json:"namespace,omitempty"`
}

ResourceNaming describes how the names for local objects should be formed.

func (*ResourceNaming) DeepCopy

func (in *ResourceNaming) DeepCopy() *ResourceNaming

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

func (*ResourceNaming) DeepCopyInto

func (in *ResourceNaming) DeepCopyInto(out *ResourceNaming)

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

type ResourceProjection

type ResourceProjection struct {
	// The API group, for example "myservice.example.com". Leave empty to not modify the API group.
	Group string `json:"group,omitempty"`
	// The API version, for example "v1beta1". Leave empty to not modify the version.
	//
	// This field must not be set when multiple versions have been selected.
	//
	// Deprecated: Use .versions instead.
	Version string `json:"version,omitempty"`
	// Versions allows to map API versions onto new values in kcp. Leave empty to not modify the
	// versions.
	Versions map[string]string `json:"versions,omitempty"`
	// Whether or not the resource is namespaced.
	// +kubebuilder:validation:Enum=Cluster;Namespaced
	Scope ResourceScope `json:"scope,omitempty"`
	// The resource Kind, for example "Database". Setting this field will also overwrite
	// the singular name by lowercasing the resource kind. In addition, if this is set,
	// the plural name will also be updated by taking the lowercased kind name and appending
	// an "s". If this would yield an undesirable name, use the plural field to explicitly
	// give the plural name.
	Kind string `json:"kind,omitempty"`
	// When overwriting the Kind, it can be necessary to also override the plural name in
	// case of more complex pluralization rules.
	Plural string `json:"plural,omitempty"`
	// ShortNames can be used to overwrite the original short names for a resource, usually
	// when the Kind is remapped, new short names are also in order. Set this to an empty
	// list to remove all short names.
	// +optional
	ShortNames []string `json:"shortNames"` // not omitempty because we need to distinguish between [] and nil
	// Categories can be used to overwrite the original categories a resource was in. Set
	// this to an empty list to remove all categories.
	// +optional
	Categories []string `json:"categories"` // not omitempty because we need to distinguish between [] and nil
}

ResourceProjection describes how the source GVK should be modified before it's published in kcp.

func (*ResourceProjection) DeepCopy

func (in *ResourceProjection) DeepCopy() *ResourceProjection

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

func (*ResourceProjection) DeepCopyInto

func (in *ResourceProjection) DeepCopyInto(out *ResourceProjection)

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

type ResourceRegexMutation

type ResourceRegexMutation struct {
	Path string `json:"path"`
	// Pattern can be left empty to simply replace the entire value with the
	// replacement.
	Pattern     string `json:"pattern,omitempty"`
	Replacement string `json:"replacement,omitempty"`
}

func (*ResourceRegexMutation) DeepCopy

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

func (*ResourceRegexMutation) DeepCopyInto

func (in *ResourceRegexMutation) DeepCopyInto(out *ResourceRegexMutation)

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

type ResourceScope

type ResourceScope string

ResourceScope is an enum defining the different scopes available to a custom resource. This ENUM matches apiextensionsv1.ResourceScope, but was copied here to avoid a costly dependency and since the ENUM will unlikely be extended/changed in future Kubernetes releases.

const (
	ClusterScoped   ResourceScope = "Cluster"
	NamespaceScoped ResourceScope = "Namespaced"
)

type ResourceTemplateMutation

type ResourceTemplateMutation struct {
	Path     string `json:"path"`
	Template string `json:"template"`
}

func (*ResourceTemplateMutation) DeepCopy

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

func (*ResourceTemplateMutation) DeepCopyInto

func (in *ResourceTemplateMutation) DeepCopyInto(out *ResourceTemplateMutation)

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

type SourceResourceDescriptor

type SourceResourceDescriptor struct {
	// The API group of a resource, for example "storage.initroid.com".
	APIGroup string `json:"apiGroup"`
	// The API version, for example "v1beta1". Setting this field will only publish
	// the given version, otherwise all versions for the group/kind will be
	// published.
	//
	// Deprecated: Use .versions instead.
	Version string `json:"version,omitempty"`
	// Versions allows to select a subset of versions to publish. Leave empty
	// to publish all available versions.
	Versions []string `json:"versions,omitempty"`
	// The resource Kind, for example "Database".
	Kind string `json:"kind"`
}

SourceResourceDescriptor uniquely describes a resource type in the cluster.

func (*SourceResourceDescriptor) DeepCopy

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

func (*SourceResourceDescriptor) DeepCopyInto

func (in *SourceResourceDescriptor) DeepCopyInto(out *SourceResourceDescriptor)

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

type SynchronizationSpec added in v0.5.0

type SynchronizationSpec struct {
	// Enabled can be used to toggle the synchronization as a whole. When set to
	// false, the syncagent will only copy the CRD and include it in the APIExport,
	// but not will attempt to synchronize objects of this resource from the kcp
	// workspaces to the provider.
	// Synchronization must be disabled for resources that are used as related
	// resources for other PublishedResources. Otherwise the syncagent would
	// potentially loop and never finish processing an object.
	Enabled bool `json:"enabled"`
}

SynchronizationSpec allows to configure how the syncagent processes a PublishedResource.

func (*SynchronizationSpec) DeepCopy added in v0.5.0

func (in *SynchronizationSpec) DeepCopy() *SynchronizationSpec

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

func (*SynchronizationSpec) DeepCopyInto added in v0.5.0

func (in *SynchronizationSpec) DeepCopyInto(out *SynchronizationSpec)

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

type TemplateExpression

type TemplateExpression struct {
	Template string `json:"template,omitempty"`
}

TemplateExpression is a Go templated string that can make use of variables to construct the resulting string.

func (*TemplateExpression) DeepCopy

func (in *TemplateExpression) DeepCopy() *TemplateExpression

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

func (*TemplateExpression) DeepCopyInto

func (in *TemplateExpression) DeepCopyInto(out *TemplateExpression)

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

Jump to

Keyboard shortcuts

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