Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=kube-green.com
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group. +kubebuilder:object:generate=true +groupName=kube-green.com
Index ¶
- Variables
- type ExcludeRef
- type SleepInfo
- func (in *SleepInfo) DeepCopy() *SleepInfo
- func (in *SleepInfo) DeepCopyInto(out *SleepInfo)
- func (in *SleepInfo) DeepCopyObject() runtime.Object
- func (s SleepInfo) GetExcludeRef() []ExcludeRef
- func (s SleepInfo) GetSleepSchedule() (string, error)
- func (s SleepInfo) GetWakeUpSchedule() (string, error)
- func (s SleepInfo) IsCronjobsToSuspend() bool
- func (s SleepInfo) IsDeploymentsToSuspend() bool
- func (s *SleepInfo) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (s *SleepInfo) ValidateCreate() error
- func (s *SleepInfo) ValidateDelete() error
- func (s *SleepInfo) ValidateUpdate(_ runtime.Object) error
- type SleepInfoList
- type SleepInfoSpec
- type SleepInfoStatus
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kube-green.com", Version: "v1alpha1"} // 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 )
Functions ¶
This section is empty.
Types ¶
type ExcludeRef ¶
type ExcludeRef struct { // ApiVersion of the kubernetes resources. // Supported api version is "apps/v1". APIVersion string `json:"apiVersion,omitempty"` // Kind of the kubernetes resources of the specific version. // Supported kind are "Deployment" and "CronJob". Kind string `json:"kind,omitempty"` // Name which identify the kubernetes resource. // +optional Name string `json:"name,omitempty"` // MatchLabels which identify the kubernetes resource by labels // +optional MatchLabels map[string]string `json:"matchLabels,omitempty"` }
func (*ExcludeRef) DeepCopy ¶
func (in *ExcludeRef) DeepCopy() *ExcludeRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExcludeRef.
func (*ExcludeRef) DeepCopyInto ¶
func (in *ExcludeRef) DeepCopyInto(out *ExcludeRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SleepInfo ¶
type SleepInfo struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec SleepInfoSpec `json:"spec,omitempty"` Status SleepInfoStatus `json:"status,omitempty"` }
SleepInfo is the Schema for the sleepinfos API
func (*SleepInfo) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SleepInfo.
func (*SleepInfo) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SleepInfo) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (SleepInfo) GetExcludeRef ¶
func (s SleepInfo) GetExcludeRef() []ExcludeRef
func (SleepInfo) GetSleepSchedule ¶
func (SleepInfo) GetWakeUpSchedule ¶
func (SleepInfo) IsCronjobsToSuspend ¶
func (SleepInfo) IsDeploymentsToSuspend ¶ added in v0.4.0
func (*SleepInfo) SetupWebhookWithManager ¶
func (*SleepInfo) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*SleepInfo) ValidateDelete ¶
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type SleepInfoList ¶
type SleepInfoList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []SleepInfo `json:"items"` }
SleepInfoList contains a list of SleepInfo
func (*SleepInfoList) DeepCopy ¶
func (in *SleepInfoList) DeepCopy() *SleepInfoList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SleepInfoList.
func (*SleepInfoList) DeepCopyInto ¶
func (in *SleepInfoList) DeepCopyInto(out *SleepInfoList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SleepInfoList) DeepCopyObject ¶
func (in *SleepInfoList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SleepInfoSpec ¶
type SleepInfoSpec struct { // Weekdays are in cron notation. // // For example, to configure a schedule from monday to friday, set it to "1-5" //+operator-sdk:csv:customresourcedefinitions:type=spec Weekdays string `json:"weekdays"` // Hours:Minutes // // Accept cron schedule for both hour and minute. // For example, *:*/2 is set to configure a run every even minute. //+operator-sdk:csv:customresourcedefinitions:type=spec SleepTime string `json:"sleepAt"` // Hours:Minutes // // Accept cron schedule for both hour and minute. // For example, *:*/2 is set to configure a run every even minute. // It is not required. // +optional //+operator-sdk:csv:customresourcedefinitions:type=spec WakeUpTime string `json:"wakeUpAt,omitempty"` // Time zone to set the schedule, in IANA time zone identifier. // It is not required, default to UTC. // For example, for the Italy time zone set Europe/Rome. // +optional //+operator-sdk:csv:customresourcedefinitions:type=spec TimeZone string `json:"timeZone,omitempty"` // ExcludeRef define the resource to exclude from the sleep. // +optional //+operator-sdk:csv:customresourcedefinitions:type=spec ExcludeRef []ExcludeRef `json:"excludeRef,omitempty"` // If SuspendCronjobs is set to true, on sleep the cronjobs of the namespace will be suspended. // +optional //+operator-sdk:csv:customresourcedefinitions:type=spec SuspendCronjobs bool `json:"suspendCronJobs,omitempty"` // If SuspendDeployments is set to false, on sleep the deployment of the namespace will not be suspended. By default Deployment will be suspended. // +optional //+operator-sdk:csv:customresourcedefinitions:type=spec SuspendDeployments *bool `json:"suspendDeployments,omitempty"` }
SleepInfoSpec defines the desired state of SleepInfo
func (*SleepInfoSpec) DeepCopy ¶
func (in *SleepInfoSpec) DeepCopy() *SleepInfoSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SleepInfoSpec.
func (*SleepInfoSpec) DeepCopyInto ¶
func (in *SleepInfoSpec) DeepCopyInto(out *SleepInfoSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SleepInfoStatus ¶
type SleepInfoStatus struct { // Information when was the last time the run was successfully scheduled. // +optional //+operator-sdk:csv:customresourcedefinitions:type=status,displayName="Last Schedule Time" LastScheduleTime metav1.Time `json:"lastScheduleTime,omitempty"` // The operation type handled in last schedule. SLEEP or WAKE_UP are the // possibilities // +optional //+operator-sdk:csv:customresourcedefinitions:type=status,displayName="Operation Type" OperationType string `json:"operation,omitempty"` }
SleepInfoStatus defines the observed state of SleepInfo
func (*SleepInfoStatus) DeepCopy ¶
func (in *SleepInfoStatus) DeepCopy() *SleepInfoStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SleepInfoStatus.
func (*SleepInfoStatus) DeepCopyInto ¶
func (in *SleepInfoStatus) DeepCopyInto(out *SleepInfoStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.