v1alpha1

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the eventing v1alpha1 API group +kubebuilder:object:generate=true +groupName=operator.kyma-project.io

+kubebuilder:validation:Optional // This sets 'required' as the default behaviour.

Index

Constants

View Source
const (
	StateReady      string = "Ready"
	StateError      string = "Error"
	StateProcessing string = "Processing"
	StateDeleting   string = "Deleting"
	StateWarning    string = "Warning"

	ConditionAvailable   ConditionType = "Available"
	ConditionStatefulSet ConditionType = "StatefulSet"
	ConditionDeleted     ConditionType = "Deleted"

	ConditionReasonProcessing           ConditionReason = "Processing"
	ConditionReasonDeploying            ConditionReason = "Deploying"
	ConditionReasonDeployed             ConditionReason = "Deployed"
	ConditionReasonDeleting             ConditionReason = "Deleting"
	ConditionReasonProcessingError      ConditionReason = "FailedProcessing"
	ConditionReasonForbidden            ConditionReason = "Forbidden"
	ConditionReasonStatefulSetAvailable ConditionReason = "Available"
	ConditionReasonStatefulSetPending   ConditionReason = "Pending"
	ConditionReasonSyncFailError        ConditionReason = "FailedToSyncResources"
	ConditionReasonManifestError        ConditionReason = "InvalidManifests"
	ConditionReasonDeletionError        ConditionReason = "DeletionError"
)

Variables

View Source
var (
	//nolint:gochecknoglobals // is used in the controller
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "operator.kyma-project.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} //nolint:gochecknoglobals // is used in the controller

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme //nolint:gochecknoglobals // is used in the controller
)

Functions

func ConditionEquals

func ConditionEquals(existing, expected metav1.Condition) bool

ConditionEquals checks if two conditions are equal.

func ConditionsEquals

func ConditionsEquals(existing, expected []metav1.Condition) bool

ConditionsEquals checks if two list of conditions are equal.

Types

type Cluster

type Cluster struct {
	// Size of a NATS cluster, i.e. number of NATS nodes.
	// +kubebuilder:default:=3
	// +kubebuilder:validation:Minimum:=1
	// +kubebuilder:validation:XValidation:rule="(self%2) != 0", message="size only accepts odd numbers"
	Size int `json:"size,omitempty"`
}

Cluster defines configurations that are specific to NATS clusters.

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

type ConditionReason

type ConditionReason string

type ConditionType

type ConditionType string

type FileStorage

type FileStorage struct {
	// StorageClassName defines the file storage class name.
	// +kubebuilder:default:="default"
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="fileStorage is immutable once it was set"
	StorageClassName string `json:"storageClassName,omitempty"`

	// Size defines the file storage size.
	// +kubebuilder:default:="1Gi"
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="fileStorage is immutable once it was set"
	Size resource.Quantity `json:"size,omitempty"`
}

FileStorage defines configurations to file storage in NATS JetStream.

func (*FileStorage) DeepCopy

func (in *FileStorage) DeepCopy() *FileStorage

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

func (*FileStorage) DeepCopyInto

func (in *FileStorage) DeepCopyInto(out *FileStorage)

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

type JetStream

type JetStream struct {
	// MemStorage defines configurations to memory storage in NATS JetStream.
	// +kubebuilder:default:={size:"1Gi",enabled:true}
	// +kubebuilder:validation:XValidation:rule="!self.enabled || self.size != 0", message="can only be enabled if size is not 0"
	MemStorage `json:"memStorage,omitempty"`

	// FileStorage defines configurations to file storage in NATS JetStream.
	// +kubebuilder:default:={storageClassName:"default",size:"1Gi"}
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="fileStorage is immutable once it was set"
	FileStorage `json:"fileStorage,omitempty"`
}

JetStream defines configurations that are specific to NATS JetStream.

func (*JetStream) DeepCopy

func (in *JetStream) DeepCopy() *JetStream

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

func (*JetStream) DeepCopyInto

func (in *JetStream) DeepCopyInto(out *JetStream)

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

type Logging

type Logging struct {
	// Debug allows debug logging.
	// +kubebuilder:default:=false
	Debug bool `json:"debug,omitempty"`

	// Trace allows trace logging.
	// +kubebuilder:default:=false
	Trace bool `json:"trace,omitempty"`
}

Logging defines logging options.

func (*Logging) DeepCopy

func (in *Logging) DeepCopy() *Logging

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

func (*Logging) DeepCopyInto

func (in *Logging) DeepCopyInto(out *Logging)

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

type MemStorage

type MemStorage struct {
	// Enabled allows the enablement of memory storage.
	// +kubebuilder:default:=true
	Enabled bool `json:"enabled,omitempty"`

	// Size defines the mem.
	// +kubebuilder:default:="1Gi"
	Size resource.Quantity `json:"size,omitempty"`
}

MemStorage defines configurations to memory storage in NATS JetStream.

func (*MemStorage) DeepCopy

func (in *MemStorage) DeepCopy() *MemStorage

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

func (*MemStorage) DeepCopyInto

func (in *MemStorage) DeepCopyInto(out *MemStorage)

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

type NATS

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

	// +kubebuilder:default:={jetStream:{fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"1Gi",enabled:true}}, cluster:{size:3},logging:{trace:false,debug:false}, resources:{limits:{cpu:"500m",memory:"1Gi"}, requests:{cpu:"40m",memory:"64Mi"}}}
	Spec   NATSSpec   `json:"spec,omitempty"`
	Status NATSStatus `json:"status,omitempty"`
}

NATS is the Schema for the NATS API. +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",description="State of NATS deployment" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Age of the resource"

func (*NATS) DeepCopy

func (in *NATS) DeepCopy() *NATS

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

func (*NATS) DeepCopyInto

func (in *NATS) DeepCopyInto(out *NATS)

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

func (*NATS) DeepCopyObject

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

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

func (*NATS) IsInDeletion

func (n *NATS) IsInDeletion() bool

type NATSList

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

NATSList contains a list of NATS.

func (*NATSList) DeepCopy

func (in *NATSList) DeepCopy() *NATSList

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

func (*NATSList) DeepCopyInto

func (in *NATSList) DeepCopyInto(out *NATSList)

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

func (*NATSList) DeepCopyObject

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

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

type NATSSpec

type NATSSpec struct {
	// Cluster defines configurations that are specific to NATS clusters.
	// +kubebuilder:default:={size:3}
	Cluster `json:"cluster,omitempty"`

	// JetStream defines configurations that are specific to NATS JetStream.
	// +kubebuilder:default:={fileStorage:{storageClassName:"default", size:"1Gi"},memStorage:{size:"1Gi",enabled:true}}
	// +kubebuilder:validation:XValidation:rule="self.fileStorage == oldSelf.fileStorage",message="fileStorage is immutable once it was set"
	JetStream `json:"jetStream,omitempty"`

	// JetStream defines configurations that are specific to NATS logging in NATS.
	// +kubebuilder:default:={trace:false,debug:false}
	Logging `json:"logging,omitempty"`

	// Resources defines resources for NATS.
	// +kubebuilder:default:={limits:{cpu:"500m",memory:"1Gi"}, requests:{cpu:"40m",memory:"64Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Annotations allows to add annotations to NATS.
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels allows to add Labels to NATS.
	Labels map[string]string `json:"labels,omitempty"`
}

NATSSpec defines the desired state of NATS.

func (*NATSSpec) DeepCopy

func (in *NATSSpec) DeepCopy() *NATSSpec

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

func (*NATSSpec) DeepCopyInto

func (in *NATSSpec) DeepCopyInto(out *NATSSpec)

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

type NATSStatus

type NATSStatus struct {
	State      string             `json:"state"`
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

NATSStatus defines the observed state of NATS.

func (*NATSStatus) DeepCopy

func (in *NATSStatus) DeepCopy() *NATSStatus

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

func (*NATSStatus) DeepCopyInto

func (in *NATSStatus) DeepCopyInto(out *NATSStatus)

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

func (*NATSStatus) FindCondition

func (ns *NATSStatus) FindCondition(conditionType ConditionType) *metav1.Condition

func (*NATSStatus) Initialize

func (ns *NATSStatus) Initialize()

func (*NATSStatus) IsEqual

func (ns *NATSStatus) IsEqual(status NATSStatus) bool

func (*NATSStatus) SetStateDeleting

func (ns *NATSStatus) SetStateDeleting()

func (*NATSStatus) SetStateError

func (ns *NATSStatus) SetStateError()

func (*NATSStatus) SetStateProcessing

func (ns *NATSStatus) SetStateProcessing()

func (*NATSStatus) SetStateReady

func (ns *NATSStatus) SetStateReady()

func (*NATSStatus) SetStateWarning added in v0.1.4

func (ns *NATSStatus) SetStateWarning()

func (*NATSStatus) SetWaitingStateForStatefulSet

func (ns *NATSStatus) SetWaitingStateForStatefulSet()

func (*NATSStatus) UpdateConditionAvailable

func (ns *NATSStatus) UpdateConditionAvailable(status metav1.ConditionStatus, reason ConditionReason,
	message string)

func (*NATSStatus) UpdateConditionDeletion

func (ns *NATSStatus) UpdateConditionDeletion(status metav1.ConditionStatus, reason ConditionReason,
	message string)

func (*NATSStatus) UpdateConditionStatefulSet

func (ns *NATSStatus) UpdateConditionStatefulSet(status metav1.ConditionStatus, reason ConditionReason,
	message string)

Jump to

Keyboard shortcuts

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