v1alpha1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 10 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

func (in *SleepInfo) DeepCopy() *SleepInfo

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

func (*SleepInfo) DeepCopyInto

func (in *SleepInfo) DeepCopyInto(out *SleepInfo)

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

func (*SleepInfo) DeepCopyObject

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

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 (s SleepInfo) GetSleepSchedule() (string, error)

func (SleepInfo) GetWakeUpSchedule

func (s SleepInfo) GetWakeUpSchedule() (string, error)

func (SleepInfo) IsCronjobsToSuspend

func (s SleepInfo) IsCronjobsToSuspend() bool

func (SleepInfo) IsDeploymentsToSuspend added in v0.4.0

func (s SleepInfo) IsDeploymentsToSuspend() bool

func (*SleepInfo) SetupWebhookWithManager

func (s *SleepInfo) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*SleepInfo) ValidateCreate

func (s *SleepInfo) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*SleepInfo) ValidateDelete

func (s *SleepInfo) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*SleepInfo) ValidateUpdate

func (s *SleepInfo) ValidateUpdate(_ runtime.Object) error

ValidateUpdate 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.

Jump to

Keyboard shortcuts

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