Documentation
¶
Overview ¶
Package v1 contains API Schema definitions for the operator v1 API group +kubebuilder:object:generate=true +groupName=operator.fhivemind.io
Index ¶
- Constants
- Variables
- func ConditionsReady(conditions []metav1.Condition) bool
- type ConditionType
- type Plant
- func (plant *Plant) ConditionsReady() bool
- func (plant *Plant) ContainsCondition(conditionType ConditionType, conditionStatus ...metav1.ConditionStatus) bool
- func (in *Plant) DeepCopy() *Plant
- func (in *Plant) DeepCopyInto(out *Plant)
- func (in *Plant) DeepCopyObject() runtime.Object
- func (r *Plant) Default()
- func (plant *Plant) DetermineState() State
- func (plant *Plant) GetWaitingConditions() (res []string)
- func (plant *Plant) OperatorLabels() map[string]string
- func (plant *Plant) RemoveCondition(conditionType ConditionType)
- func (r *Plant) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (plant *Plant) UpdateCondition(conditionType ConditionType, status bool, reason, msg string)
- func (r *Plant) ValidateCreate() error
- func (r *Plant) ValidateDelete() error
- func (r *Plant) ValidateUpdate(old runtime.Object) error
- type PlantList
- type PlantSpec
- type PlantStatus
- type ResourceStatus
- type State
Constants ¶
const ( DefaultContainerPort int32 = 80 // DefaultContainerPort defines the default value of ContainerPort for CRD DefaultReplicaCount int32 = 1 // DefaultReplicaCount defines the default value of Replicas for CRD )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "operator.fhivemind.io", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
var ( GroupName = GroupVersion.Group // GroupName exports defined operator group Finalizer = GroupName // Finalizer defines CRD resource finalizer name ManagedByLabel = GroupName + "/" + "managed-by" // ManagedByLabel defines a kind-based owner label OwnerNameLabel = GroupName + "/" + "owner-name" // OwnerNameLabel defines a resource-based owner label PlantKind = "Plant" // PlantKind exports Plant operator kind PlantOperator = "plant-operator" // PlantOperator exports Plant operator name )
Functions ¶
func ConditionsReady ¶
ConditionsReady returns true if all Conditions are satisfied.
Types ¶
type ConditionType ¶
type ConditionType string
ConditionType sets the type to a concrete type for safety.
func ConditionTypeAvailableFor ¶
func ConditionTypeAvailableFor(name string) ConditionType
type Plant ¶
type Plant struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PlantSpec `json:"spec,omitempty"`
Status PlantStatus `json:"status,omitempty"`
}
Plant is the Schema for the plants API.
func (*Plant) ConditionsReady ¶
ConditionsReady returns true if all Conditions are satisfied for Plant.
func (*Plant) ContainsCondition ¶
func (plant *Plant) ContainsCondition(conditionType ConditionType, conditionStatus ...metav1.ConditionStatus) bool
ContainsCondition returns true if the given condition is equal to any of the statuses.
func (*Plant) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plant.
func (*Plant) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Plant) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Plant) Default ¶
func (r *Plant) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (*Plant) DetermineState ¶
DetermineState returns calculated state from resource and conditions.
func (*Plant) GetWaitingConditions ¶
GetWaitingConditions returns not ready conditions.
func (*Plant) OperatorLabels ¶
func (*Plant) RemoveCondition ¶
func (plant *Plant) RemoveCondition(conditionType ConditionType)
RemoveCondition removes a condiditon
func (*Plant) SetupWebhookWithManager ¶
func (*Plant) UpdateCondition ¶
func (plant *Plant) UpdateCondition(conditionType ConditionType, status bool, reason, msg string)
UpdateCondition updates specific condition based on type.
func (*Plant) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*Plant) ValidateDelete ¶
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type PlantList ¶
type PlantList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Plant `json:"items"`
}
PlantList contains a list of Plant
func (*PlantList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlantList.
func (*PlantList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PlantList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PlantSpec ¶
type PlantSpec struct {
// Image specifies the image use for Deployment containers.
//+kubebuilder:validation:Required
Image string `json:"image,omitempty"`
// ContainerPort to expose for host traffic.
// Defaults to 80.
// +optional
ContainerPort *int32 `json:"containerPort,omitempty"`
// Replicas defines the number of desired pods to deploy.
// Defaults to 1.
// +kubebuilder:validation:Minimum=1
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Host defines the domain name of a network host where the deployed image will be accessible.
// Follows RFC 3986 standard.
// +kubebuilder:validation:Required
Host string `json:"host,omitempty"`
// IngressClassName specifies the name of the Ingress controller to use. If not set,
// it will use cluster default Ingress class.
// +optional
IngressClassName *string `json:"ingressClassName,omitempty"`
// TlsSecretName can be used to specify the name of an existing TLS secret for given host.
// Specify either TlsSecretName or TlsCertIssuerRef, but not both.
// +optional
TlsSecretName *string `json:"tlsSecretName,omitempty"`
// TlsCertIssuerRef specifies the name Cert Manager Issuer to use for
// obtaining certificates.
// Specify either TlsSecretName or TlsCertIssuerRef, but not both.
// +optional
TlsCertIssuerRef *cmmeta.ObjectReference `json:"tlsCertIssuerRef,omitempty"`
}
PlantSpec defines the desired state of Plant
func (*PlantSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlantSpec.
func (*PlantSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlantStatus ¶
type PlantStatus struct {
// State signifies current state of Plant.
State State `json:"state,omitempty"`
// Conditions defines a list which indicates the status of the Plant.
// +optional
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Resources contains various identifiers about managed objects' states.
Resources []ResourceStatus `json:"objects,omitempty"`
// LastUpdateTime specifies the last time this resource has been updated.
// +optional
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
}
PlantStatus defines the observed state of Plant
func (*PlantStatus) DeepCopy ¶
func (in *PlantStatus) DeepCopy() *PlantStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlantStatus.
func (*PlantStatus) DeepCopyInto ¶
func (in *PlantStatus) DeepCopyInto(out *PlantStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceStatus ¶
type ResourceStatus struct {
Name string `json:"name,omitempty"`
GVK string `json:"gvk,omitempty"`
UID types.UID `json:"UID,omitempty"`
State State `json:"state,omitempty"`
}
ResourceStatus defines the observed state of Plant-managed or other objects. If more context is required, embed into the object.
func (*ResourceStatus) DeepCopy ¶
func (in *ResourceStatus) DeepCopy() *ResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus.
func (*ResourceStatus) DeepCopyInto ¶
func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type State ¶
type State string
State defines all possible resource states +kubebuilder:validation:Enum=Processing;Deleting;Ready;Error;""
const ( // StateReady implies that the resource is ready and has been installed successfully. StateReady State = "Ready" // StateProcessing implies that the resource has just started or is being fixed by reconciliation. StateProcessing State = "Processing" // StateError implies an error for the resource occurred. The state can during next reconsiliation. StateError State = "Error" // StateDeleting implies the resource is being deleted. StateDeleting State = "Deleting" )