v1

package
v0.0.0-...-30e5fb0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaintainanceWindow

type MaintainanceWindow struct {
	// Start is the start time of the maintenance window.
	// Allowed formats are [time.TimeOnly] and "15:04:05Z07:00".
	Start Time `json:"start" yaml:"start" mapstructure:"start"`
	// End is the end time of the maintenance window.
	// Allowed formats are [time.TimeOnly] and "15:04:05Z07:00".
	End Time `json:"end" yaml:"end" mapstructure:"end"`
}

MaintainanceWindow represents the maintenance window.

func (*MaintainanceWindow) Validate

func (m *MaintainanceWindow) Validate() error

Validate checks if the maintenance window is valid. It implements the [config.Validator] interface.

type OperatorConfig

type OperatorConfig struct {
	// MaintainanceWindow is the maintenance window the operator allows changes to workloads.
	MaintainanceWindow MaintainanceWindow `json:"maintainanceWindow" yaml:"maintainanceWindow" mapstructure:"maintainanceWindow" validate:"required"`
}

OperatorConfig is the configuration for the operator.

func LoadConfig

func LoadConfig(ctx context.Context, c client.Client) (*OperatorConfig, error)

LoadConfig loads the operator configuration from the Kubernetes API.

type Time

type Time struct {
	time.Time
	// contains filtered or unexported fields
}

Time is a wrapper around the time.Time type that supports JSON and YAML serialization.

It supports the following formats:

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Time) MarshalYAML

func (t *Time) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*Time) String

func (t *Time) String() string

String returns the formatted time string.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*Time) UnmarshalYAML

func (t *Time) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type WorkloadUpdateConfig

type WorkloadUpdateConfig struct {
	metav1.TypeMeta   `json:",inline" yaml:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	Spec              OperatorConfig `json:"spec" yaml:"spec"`
}

func (*WorkloadUpdateConfig) DeepCopyObject

func (o *WorkloadUpdateConfig) DeepCopyObject() runtime.Object

DeepCopyObject implements the runtime.Object interface.

Jump to

Keyboard shortcuts

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