component

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 43 Imported by: 30

Documentation

Overview

Package component contains central interfaces (most importantly, the Component interface) and the generic component reconciler.

Index

Constants

View Source
const (
	PhaseScheduledForApplication = "ScheduledForApplication"
	PhaseScheduledForDeletion    = "ScheduledForDeletion"
	PhaseScheduledForCompletion  = "ScheduledForCompletion"
	PhaseCreating                = "Creating"
	PhaseUpdating                = "Updating"
	PhaseDeleting                = "Deleting"
	PhaseCompleting              = "Completing"
	PhaseReady                   = "Ready"
	PhaseCompleted               = "Completed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfiguration added in v0.2.3

type ClientConfiguration interface {
	// Get kubeconfig content. Should return nil if default local client shall be used.
	GetKubeConfig() []byte
}

The ClientConfiguration interface is meant to be implemented by components (or their spec) which offer remote deployments.

type ClientSpec added in v0.2.3

type ClientSpec struct {
	KubeConfig *KubeConfigSpec `json:"kubeConfig,omitempty"`
}

ClientSpec defines a reference to another cluster by kubeconfig. Components providing ClientConfiguration may include this into their spec.

func (*ClientSpec) DeepCopy added in v0.2.3

func (in *ClientSpec) DeepCopy() *ClientSpec

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

func (*ClientSpec) DeepCopyInto added in v0.2.3

func (in *ClientSpec) DeepCopyInto(out *ClientSpec)

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

func (*ClientSpec) GetKubeConfig added in v0.2.3

func (s *ClientSpec) GetKubeConfig() []byte

Implement the ClientConfiguration interface.

type Component

type Component interface {
	client.Object
	// Return a read-only accessor to the component's spec.
	// The returned value has to implement the types.Unstructurable interface.
	GetSpec() types.Unstructurable
	// Return a read-write (usually a pointer) accessor to the component's status,
	// resp. to the corresponding substruct if the status extends component.Status.
	GetStatus() *Status
}

Component is the central interface that component operators have to implement. Besides being a conroller-runtime client.Object, the implementing type has to expose accessor methods for the components's spec and status, GetSpec() and GetStatus().

type Condition

type Condition struct {
	Type ConditionType `json:"type"`
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status ConditionStatus `json:"status"`
	// +optional
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
	// +optional
	Reason string `json:"reason,omitempty"`
	// +optional
	Message string `json:"message,omitempty"`
}

Component status Condition.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type ConditionStatus

type ConditionStatus string

Condition Status. Can be one of 'True', 'False', 'Unknown'.

const (
	// Condition status 'True'.
	ConditionTrue ConditionStatus = "True"
	// Condition status 'False'.
	ConditionFalse ConditionStatus = "False"
	// Condition status 'Unknown'.
	ConditionUnknown ConditionStatus = "Unknown"
)

type ConditionType

type ConditionType string

Condition type. Currently, only the 'Ready' type is used.

const (
	// Condition type representing the 'Ready' condition.
	ConditionTypeReady ConditionType = "Ready"
)

type ConfigMapKeyReference added in v0.2.3

type ConfigMapKeyReference struct {
	// +required
	Name string `json:"name"`
	// +optional
	Key string `json:"key,omitempty"`
	// contains filtered or unexported fields
}

ConfigMapKeyReference defines a loadable reference to a configmap key.

func (*ConfigMapKeyReference) DeepCopy added in v0.2.3

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

func (*ConfigMapKeyReference) DeepCopyInto added in v0.2.3

func (in *ConfigMapKeyReference) DeepCopyInto(out *ConfigMapKeyReference)

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

func (*ConfigMapKeyReference) Value added in v0.2.3

func (r *ConfigMapKeyReference) Value() string

Return the previously loaded value of the configmap key.

type ConfigMapReference added in v0.2.3

type ConfigMapReference struct {
	// +required
	Name string `json:"name"`
	// contains filtered or unexported fields
}

ConfigMapReference defines a loadable reference to a configmap.

func (*ConfigMapReference) Data added in v0.2.3

func (r *ConfigMapReference) Data() map[string]string

Return the previously loaded configmap data.

func (*ConfigMapReference) DeepCopy added in v0.2.3

func (in *ConfigMapReference) DeepCopy() *ConfigMapReference

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

func (*ConfigMapReference) DeepCopyInto added in v0.2.3

func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference)

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

type HookFunc

type HookFunc[T Component] func(ctx context.Context, client client.Client, component T) error

HookFunc is the function signature that can be used to establish callbacks at certain points in the reconciliation logic. Hooks will be passed the current (potentially unsaved) state of the component. Post-hooks will only be called if the according operation (read, reconcile, delete) has been successful.

type ImageSpec

type ImageSpec struct {
	// +kubebuilder:validation:MinLength=1
	Repository string `json:"repository,omitempty"`
	// +kubebuilder:validation:MinLength=1
	Tag string `json:"tag,omitempty"`
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	// +kubebuilder:default=IfNotPresent
	PullPolicy string `json:"pullPolicy,omitempty"`
	PullSecret string `json:"pullSecret,omitempty"`
}

ImageSpec defines the used OCI image

func (*ImageSpec) DeepCopy

func (in *ImageSpec) DeepCopy() *ImageSpec

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

func (*ImageSpec) DeepCopyInto

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

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

type ImpersonationConfiguration added in v0.2.3

type ImpersonationConfiguration interface {
	// Return impersonation user. Should return system:serviceaccount:<namespace>:<serviceaccount>
	// if a service account is used for impersonation. Should return an empty string
	// if user shall not be impersonated.
	GetImpersonationUser() string
	// Return impersonation groups. Should return nil if groups shall not be impersonated.
	GetImpersonationGroups() []string
}

The ImpersonationConfiguration interface is meant to be implemented by components (or their spec) which offer impersonated deployments.

type ImpersonationSpec added in v0.2.3

type ImpersonationSpec struct {
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

ImpersonationSpec defines a service account name. Components providing ImpersonationConfiguration may include this into their spec.

func (*ImpersonationSpec) DeepCopy added in v0.2.3

func (in *ImpersonationSpec) DeepCopy() *ImpersonationSpec

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

func (*ImpersonationSpec) DeepCopyInto added in v0.2.3

func (in *ImpersonationSpec) DeepCopyInto(out *ImpersonationSpec)

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

func (*ImpersonationSpec) GetImpersonationGroups added in v0.2.3

func (s *ImpersonationSpec) GetImpersonationGroups() []string

Implement the ImpersonationConfiguration interface.

func (*ImpersonationSpec) GetImpersonationUser added in v0.2.3

func (s *ImpersonationSpec) GetImpersonationUser() string

Implement the ImpersonationConfiguration interface.

type IngressProperties

type IngressProperties struct {
	Class       string            `json:"class,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

IngressProperties defines K8s properties to be applied to a managed ingress resource.

func (*IngressProperties) DeepCopy

func (in *IngressProperties) DeepCopy() *IngressProperties

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

func (*IngressProperties) DeepCopyInto

func (in *IngressProperties) DeepCopyInto(out *IngressProperties)

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

type InventoryItem

type InventoryItem struct {
	// Type of the dependent object.
	TypeInfo `json:",inline"`
	// Namespace and name of the dependent object.
	NameInfo `json:",inline"`
	// Managed types
	ManagedTypes []TypeInfo `json:"managedTypes,omitempty"`
	// Digest of the descriptor of the dependent object.
	Digest string `json:"digest"`
	// Phase of the dependent object.
	Phase string `json:"phase,omitempty"`
	// Observed status of the dependent object, as observed by kstatus.
	Status string `json:"status,omitempty"`
}

InventoryItem represents a dependent object managed by this operator.

func (*InventoryItem) DeepCopy

func (in *InventoryItem) DeepCopy() *InventoryItem

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

func (*InventoryItem) DeepCopyInto

func (in *InventoryItem) DeepCopyInto(out *InventoryItem)

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

func (InventoryItem) GetName

func (i InventoryItem) GetName() string

Get inventory item's name.

func (InventoryItem) GetNamespace

func (i InventoryItem) GetNamespace() string

Get inventory item's namespace.

func (*InventoryItem) GetObjectKind

func (i *InventoryItem) GetObjectKind() schema.ObjectKind

Get inventory item's ObjectKind accessor.

func (InventoryItem) GroupVersionKind

func (i InventoryItem) GroupVersionKind() schema.GroupVersionKind

Get inventory item's GroupVersionKind.

func (InventoryItem) Matches

func (i InventoryItem) Matches(key types.ObjectKey) bool

Check whether inventory item matches given ObjectKey, in the sense that Group, Kind, Namespace and Name are the same. Note that this does not compare the group's Version.

func (*InventoryItem) SetGroupVersionKind

func (i *InventoryItem) SetGroupVersionKind(gvk schema.GroupVersionKind)

Set inventory item's GroupVersionKind.

func (InventoryItem) String

func (i InventoryItem) String() string

Return a string representation of the inventory item; makes InventoryItem implement the Stringer interface.

type KubeConfigSpec added in v0.2.3

type KubeConfigSpec struct {
	SecretRef SecretKeyReference `json:"secretRef" fallbackKeys:"value,value.yaml,value.yml"`
}

KubeConfigSpec defines a reference to a kubeconfig.

func (*KubeConfigSpec) DeepCopy added in v0.2.3

func (in *KubeConfigSpec) DeepCopy() *KubeConfigSpec

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

func (*KubeConfigSpec) DeepCopyInto added in v0.2.3

func (in *KubeConfigSpec) DeepCopyInto(out *KubeConfigSpec)

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

type KubernetesContainerProperties

type KubernetesContainerProperties struct {
	SecurityContext *corev1.SecurityContext      `json:"securityContext,omitempty"`
	Resources       *corev1.ResourceRequirements `json:"resources,omitempty"`
}

KubernetesContainerProperties defines K8s properties to be applied to the created workloads (container level)

func (*KubernetesContainerProperties) DeepCopy

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

func (*KubernetesContainerProperties) DeepCopyInto

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

type KubernetesPodProperties

type KubernetesPodProperties struct {
	NodeSelector              map[string]string                 `json:"nodeSelector,omitempty"`
	Affinity                  *corev1.Affinity                  `json:"affinity,omitempty"`
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
	Tolerations               []corev1.Toleration               `json:"tolerations,omitempty"`
	PriorityClassName         *string                           `json:"priorityClassName,omitempty"`
	PodSecurityContext        *corev1.PodSecurityContext        `json:"podSecurityContext,omitempty"`
	Labels                    map[string]string                 `json:"podLabels,omitempty"`
	Annotations               map[string]string                 `json:"podAnnotations,omitempty"`
}

KubernetesPodProperties defines K8s properties to be applied to the created workloads (pod level)

func (*KubernetesPodProperties) DeepCopy

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

func (*KubernetesPodProperties) DeepCopyInto

func (in *KubernetesPodProperties) DeepCopyInto(out *KubernetesPodProperties)

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

type KubernetesProperties

type KubernetesProperties struct {
	KubernetesPodProperties       `json:",inline"`
	KubernetesContainerProperties `json:",inline"`
}

KubernetesProperties defines a union of KubernetesPodProperties and KubernetesContainerProperties. Useful in cases where a controller pod has exactly one container.

func (*KubernetesProperties) DeepCopy

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

func (*KubernetesProperties) DeepCopyInto

func (in *KubernetesProperties) DeepCopyInto(out *KubernetesProperties)

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

type NameInfo

type NameInfo struct {
	// Namespace of the referenced object; empty for non-namespaced objects
	Namespace string `json:"namespace,omitempty"`
	// Name of the referenced object.
	Name string `json:"name"`
}

NameInfo represents an object's namespace and name.

type PlacementConfiguration added in v0.2.3

type PlacementConfiguration interface {
	// Return target namespace for the component deployment.
	// If the returned value is not the empty string, then this is the value that will be passed
	// to Generator.Generate() as namespace and, in addition, rendered namespaced resources with
	// unspecified namespace will be placed in this namespace.
	GetDeploymentNamespace() string
	// Return target name for the component deployment.
	// If the returned value is not the empty string, then this is the value that will be passed
	// to Generator.Generator() as name.
	GetDeploymentName() string
}

The PlacementConfiguration interface is meant to be implemented by components (or their spec) which allow to explicitly specify target namespace and name of the deployment (otherwise this will be defaulted as the namespace and name of the component object itself).

type PlacementSpec added in v0.2.3

type PlacementSpec struct {
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name,omitempty"`
}

PlacementSpec defines a namespace and name. Components providing PlacementConfiguration may include this into their spec.

func (*PlacementSpec) DeepCopy added in v0.2.3

func (in *PlacementSpec) DeepCopy() *PlacementSpec

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

func (*PlacementSpec) DeepCopyInto added in v0.2.3

func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec)

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

func (*PlacementSpec) GetDeploymentName added in v0.2.3

func (s *PlacementSpec) GetDeploymentName() string

Implement the PlacementConfiguration interface.

func (*PlacementSpec) GetDeploymentNamespace added in v0.2.3

func (s *PlacementSpec) GetDeploymentNamespace() string

Implement the PlacementConfiguration interface.

type Reconciler

type Reconciler[T Component] struct {
	// contains filtered or unexported fields
}

Reconciler provides the implementation of controller-runtime's Reconciler interface, for a given Component type T.

func NewReconciler

func NewReconciler[T Component](name string, client client.Client, discoveryClient discovery.DiscoveryInterface, eventRecorder record.EventRecorder, scheme *runtime.Scheme, resourceGenerator manifests.Generator) *Reconciler[T]

Create a new Reconciler. Here, name should be a meaningful and unique name identifying this reconciler within the Kubernetes cluster; it will be used in annotations, finalizers, and so on; resourceGenerator must be an implementation of the manifests.Generator interface.

Deprecation warning: the parameters client, discoveryClient, eventRecorder, scheme are ignored (can be passed as nil) and will be removed in a future release; in their place, the according clients will be derived directly from the responsible manager, as passed to SetupWithmanager().

func (*Reconciler[T]) Reconcile

func (r *Reconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error)

Reconcile contains the actual reconciliation logic.

func (*Reconciler[T]) SetupWithManager

func (r *Reconciler[T]) SetupWithManager(mgr ctrl.Manager) error

Register the reconciler with a given controller-runtime Manager.

func (*Reconciler[T]) WithPostDeleteHook

func (r *Reconciler[T]) WithPostDeleteHook(hook HookFunc[T]) *Reconciler[T]

Register post-delete hook with reconciler. This hook will be called if the reconciled component is in deletion (has a deletionTimestamp set), right after the deletion of the dependent objects happened, and was successful.

func (*Reconciler[T]) WithPostReadHook

func (r *Reconciler[T]) WithPostReadHook(hook HookFunc[T]) *Reconciler[T]

Register post-read hook with reconciler. This hook will be called after the reconciled component object has been retrieved from the Kubernetes API.

func (*Reconciler[T]) WithPostReconcileHook

func (r *Reconciler[T]) WithPostReconcileHook(hook HookFunc[T]) *Reconciler[T]

Register post-reconcile hook with reconciler. This hook will be called if the reconciled component is not in deletion (has no deletionTimestamp set), right after the reconcilation of the dependent objects happened, and was successful.

func (*Reconciler[T]) WithPreDeleteHook

func (r *Reconciler[T]) WithPreDeleteHook(hook HookFunc[T]) *Reconciler[T]

Register pre-delete hook with reconciler. This hook will be called if the reconciled component is in deletion (has a deletionTimestamp set), right before the deletion of the dependent objects starts.

func (*Reconciler[T]) WithPreReconcileHook

func (r *Reconciler[T]) WithPreReconcileHook(hook HookFunc[T]) *Reconciler[T]

Register pre-reconcile hook with reconciler. This hook will be called if the reconciled component is not in deletion (has no deletionTimestamp set), right before the reconcilation of the dependent objects starts.

type RequeueConfiguration added in v0.2.3

type RequeueConfiguration interface {
	// Get requeue interval. Should be greater than 1 minute.
	GetRequeueInterval() time.Duration
}

The RequeueConfiguration interface is meant to be implemented by components (or their spec) which offer tweaking the requeue interval (by default, it would be 10 minutes).

type RequeueSpec added in v0.2.3

type RequeueSpec struct {
	// +kubebuilder:validation:Type:=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	RequeueInterval *metav1.Duration `json:"requeueInterval,omitempty"`
}

RequeueSpec defines the requeue interval, that is, the interval after which components will be re-reconciled after a successful reconciliation. Components providing RequeueConfiguration may include this into their spec.

func (*RequeueSpec) DeepCopy added in v0.2.3

func (in *RequeueSpec) DeepCopy() *RequeueSpec

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

func (*RequeueSpec) DeepCopyInto added in v0.2.3

func (in *RequeueSpec) DeepCopyInto(out *RequeueSpec)

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

func (*RequeueSpec) GetRequeueInterval added in v0.2.3

func (s *RequeueSpec) GetRequeueInterval() time.Duration

Implement the RequeueConfiguration interface.

type RetryConfiguration added in v0.2.3

type RetryConfiguration interface {
	// Get retry interval. Should be greater than 1 minute.
	GetRetryInterval() time.Duration
}

The RetryConfiguration interface is meant to be implemented by components (or their spec) which offer tweaking the retry interval (by default, it would be the value of the requeue interval).

type RetrySpec added in v0.2.3

type RetrySpec struct {
	// +kubebuilder:validation:Type:=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	RetryInterval *metav1.Duration `json:"retryInterval,omitempty"`
}

RetrySpec defines the retry interval, that is, the interval after which components will be re-reconciled after a successful reconciliation. Components providing RetryConfiguration may include this into their spec.

func (*RetrySpec) DeepCopy added in v0.2.3

func (in *RetrySpec) DeepCopy() *RetrySpec

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

func (*RetrySpec) DeepCopyInto added in v0.2.3

func (in *RetrySpec) DeepCopyInto(out *RetrySpec)

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

func (*RetrySpec) GetRetryInterval added in v0.2.3

func (s *RetrySpec) GetRetryInterval() time.Duration

Implement the RetryConfiguration interface.

type SecretKeyReference added in v0.2.3

type SecretKeyReference struct {
	// +required
	Name string `json:"name"`
	// +optional
	Key string `json:"key,omitempty"`
	// contains filtered or unexported fields
}

SecretKeyReference defines a loadable reference to a secret key.

func (*SecretKeyReference) DeepCopy added in v0.2.3

func (in *SecretKeyReference) DeepCopy() *SecretKeyReference

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

func (*SecretKeyReference) DeepCopyInto added in v0.2.3

func (in *SecretKeyReference) DeepCopyInto(out *SecretKeyReference)

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

func (*SecretKeyReference) Value added in v0.2.3

func (r *SecretKeyReference) Value() []byte

Return the previously loaded value of the secret key.

type SecretReference added in v0.2.3

type SecretReference struct {
	// +required
	Name string `json:"name"`
	// contains filtered or unexported fields
}

SecretReference defines a loadable reference to a secret.

func (*SecretReference) Data added in v0.2.3

func (r *SecretReference) Data() map[string][]byte

Return the previously loaded secret data.

func (*SecretReference) DeepCopy added in v0.2.3

func (in *SecretReference) DeepCopy() *SecretReference

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

func (*SecretReference) DeepCopyInto added in v0.2.3

func (in *SecretReference) DeepCopyInto(out *SecretReference)

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

type ServiceProperties

type ServiceProperties struct {
	// +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer;ExternalName
	// +kubebuilder:default=ClusterIP
	Type                     corev1.ServiceType `json:"type,omitempty"`
	LoadBalancerSourceRanges []string           `json:"loadBalancerSourceRanges,omitempty"`
	// +kubebuilder:validation:Enum=Cluster;Local
	// +kubebuilder:default=Cluster
	ExternalTrafficPolicy corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"`
	Labels                map[string]string                       `json:"labels,omitempty"`
	Annotations           map[string]string                       `json:"annotations,omitempty"`
}

ServiceProperties defines K8s properties to be applied to a managed service resource.

func (*ServiceProperties) DeepCopy

func (in *ServiceProperties) DeepCopy() *ServiceProperties

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

func (*ServiceProperties) DeepCopyInto

func (in *ServiceProperties) DeepCopyInto(out *ServiceProperties)

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

type Spec

type Spec struct {
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name,omitempty"`
}

Legacy placement spec. Components may include this into their spec. Deprecation warning: use PlacementSpec instead.

func (*Spec) DeepCopy

func (in *Spec) DeepCopy() *Spec

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

func (*Spec) DeepCopyInto

func (in *Spec) DeepCopyInto(out *Spec)

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

type State

type State string

Component state. Can be one of 'Ready', 'Processing', 'Error', 'Deleting'.

const (
	// Component state 'Ready'.
	StateReady State = "Ready"
	// Component state 'Processing'.
	StateProcessing State = "Processing"
	// Component state 'Error'.
	StateError State = "Error"
	// Component state 'Deleting'.
	StateDeleting State = "Deleting"
)

type Status

type Status struct {
	ObservedGeneration int64        `json:"observedGeneration"`
	AppliedGeneration  int64        `json:"appliedGeneration,omitempty"`
	LastObservedAt     *metav1.Time `json:"lastObservedAt,omitempty"`
	LastAppliedAt      *metav1.Time `json:"lastAppliedAt,omitempty"`
	Conditions         []Condition  `json:"conditions,omitempty"`
	// +kubebuilder:validation:Enum=Processing;Deleting;Ready;Error
	State     State            `json:"state,omitempty"`
	Inventory []*InventoryItem `json:"inventory,omitempty"`
}

Component Status. Components must include this into their status.

func (*Status) DeepCopy

func (in *Status) DeepCopy() *Status

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

func (*Status) DeepCopyInto

func (in *Status) DeepCopyInto(out *Status)

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

func (*Status) GetState

func (s *Status) GetState() (State, string, string)

Get state (and related details).

func (*Status) SetState

func (s *Status) SetState(state State, reason string, message string)

Set state and ready condition in status (according to the state value provided),

type TypeInfo

type TypeInfo struct {
	// API group.
	Group string `json:"group"`
	// API group version.
	Version string `json:"version"`
	// API kind.
	Kind string `json:"kind"`
}

TypeInfo represents a Kubernetes type.

Jump to

Keyboard shortcuts

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