v1alpha1

package
v0.0.0-...-afddf54 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the kuesta v1alpha1 API group +kubebuilder:object:generate=true +groupName=kuesta.hrk091.dev

Index

Constants

View Source
const (
	AnnKeyResetStatus = "kuesta.hrk091.dev/reset"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "kuesta.hrk091.dev", 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 DeviceConfig

type DeviceConfig struct {
	// Digest is a digest to uniquely identify the overall device config
	Checksum string `json:"checksum"`

	// GitRevision is a revision from which this device config is provided
	GitRevision string `json:"gitRevision"`
}

DeviceConfig provides a digest and other required info of the device config to be provisioned.

func (*DeviceConfig) DeepCopy

func (in *DeviceConfig) DeepCopy() *DeviceConfig

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

func (*DeviceConfig) DeepCopyInto

func (in *DeviceConfig) DeepCopyInto(out *DeviceConfig)

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

type DeviceConfigMap

type DeviceConfigMap map[string]DeviceConfig

func (DeviceConfigMap) DeepCopy

func (in DeviceConfigMap) DeepCopy() DeviceConfigMap

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

func (DeviceConfigMap) DeepCopyInto

func (in DeviceConfigMap) DeepCopyInto(out *DeviceConfigMap)

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

func (DeviceConfigMap) Equal

type DeviceRollout

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

	Spec   DeviceRolloutSpec   `json:"spec,omitempty"`
	Status DeviceRolloutStatus `json:"status,omitempty"`
}

DeviceRollout is the Schema for the devicerollouts API.

func (*DeviceRollout) DeepCopy

func (in *DeviceRollout) DeepCopy() *DeviceRollout

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

func (*DeviceRollout) DeepCopyInto

func (in *DeviceRollout) DeepCopyInto(out *DeviceRollout)

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

func (*DeviceRollout) DeepCopyObject

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

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

func (*DeviceRollout) UpdateStatus

func (dr *DeviceRollout) UpdateStatus() bool

UpdateStatus updates DeviceRollout's phase, status and StatusMaps according to the device statuses. Devices statuses are updated by respective device driver(operator) and this function will aggregate these remote device statuses into one summarized transaction status.

type DeviceRolloutList

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

DeviceRolloutList contains a list of DeviceRollout.

func (*DeviceRolloutList) DeepCopy

func (in *DeviceRolloutList) DeepCopy() *DeviceRolloutList

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

func (*DeviceRolloutList) DeepCopyInto

func (in *DeviceRolloutList) DeepCopyInto(out *DeviceRolloutList)

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

func (*DeviceRolloutList) DeepCopyObject

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

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

type DeviceRolloutSpec

type DeviceRolloutSpec struct {
	// DeviceConfigMap is a map to bind device name and DeviceConfig to be provisioned
	DeviceConfigMap DeviceConfigMap `json:"deviceConfigMap"`
}

DeviceRolloutSpec defines the desired state of DeviceRollout.

func (*DeviceRolloutSpec) DeepCopy

func (in *DeviceRolloutSpec) DeepCopy() *DeviceRolloutSpec

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

func (*DeviceRolloutSpec) DeepCopyInto

func (in *DeviceRolloutSpec) DeepCopyInto(out *DeviceRolloutSpec)

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

type DeviceRolloutStatus

type DeviceRolloutStatus struct {
	// Phase is the rollout phase
	// +optional
	Phase RolloutPhase `json:"phase,omitempty"`

	// Status is the rollout status
	// +optional
	Status RolloutStatus `json:"status,omitempty"`

	// DeviceStatusMap is the rollout status
	// +optional
	DeviceStatusMap map[string]DeviceStatus `json:"deviceStatusMap,omitempty"`

	// PrevDeviceConfigMap represents the successfully provisioned device configs in the previous transaction
	// +optional
	PrevDeviceConfigMap DeviceConfigMap `json:"prevDeviceConfigMap,omitempty"`

	// DesiredDeviceConfigMap represents the desired device configs to be provisioned in the current transaction
	// +optional
	DesiredDeviceConfigMap DeviceConfigMap `json:"desiredDeviceConfigMap,omitempty"`
}

DeviceRolloutStatus defines the observed state of DeviceRollout.

func (*DeviceRolloutStatus) DeepCopy

func (in *DeviceRolloutStatus) DeepCopy() *DeviceRolloutStatus

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

func (*DeviceRolloutStatus) DeepCopyInto

func (in *DeviceRolloutStatus) DeepCopyInto(out *DeviceRolloutStatus)

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

func (*DeviceRolloutStatus) GetDeviceStatus

func (s *DeviceRolloutStatus) GetDeviceStatus(name string) DeviceStatus

GetDeviceStatus returns the device config of the given name.

func (*DeviceRolloutStatus) IsRunning

func (s *DeviceRolloutStatus) IsRunning() bool

IsRunning returns true when rollout status is in `Running`.

func (*DeviceRolloutStatus) IsTxCompleted

func (s *DeviceRolloutStatus) IsTxCompleted() bool

IsTxCompleted returns true when all device statuses are `Completed` or `Synced`.

func (*DeviceRolloutStatus) IsTxFailed

func (s *DeviceRolloutStatus) IsTxFailed() bool

IsTxFailed returns true when one or more device statuses are `Failed` or `ConnectionError`.

func (*DeviceRolloutStatus) IsTxIdle

func (s *DeviceRolloutStatus) IsTxIdle() bool

IsTxIdle returns true all device statuses are not `Running`.

func (*DeviceRolloutStatus) IsTxRunning

func (s *DeviceRolloutStatus) IsTxRunning() bool

IsTxRunning returns true when one or more device statuses are `Running`.

func (*DeviceRolloutStatus) ResolveNextDeviceConfig

func (s *DeviceRolloutStatus) ResolveNextDeviceConfig(name string) *DeviceConfig

ResolveNextDeviceConfig returns the next device config to transition to according to the current RolloutPhase.

func (*DeviceRolloutStatus) SetDeviceStatus

func (s *DeviceRolloutStatus) SetDeviceStatus(name string, status DeviceStatus)

SetDeviceStatus records the given device config to the device status map.

func (*DeviceRolloutStatus) StartTx

func (s *DeviceRolloutStatus) StartTx()

StartTx initializes device transaction statuses.

type DeviceStatus

type DeviceStatus string

DeviceStatus are a set of rollout progress.

const (
	// DeviceStatusRunning indicates that a transaction is in progress.
	DeviceStatusRunning DeviceStatus = "Running"

	// DeviceStatusCompleted indicates provision is completed.
	DeviceStatusCompleted DeviceStatus = "Completed"

	// DeviceStatusFailed indicates that provision is failed.
	DeviceStatusFailed DeviceStatus = "Failed"

	// DeviceStatusConnectionError indicates that provision is failed due to connection error.
	DeviceStatusConnectionError DeviceStatus = "ConnectionError"

	// DeviceStatusPurged indicates that the device is not included in desired state.
	DeviceStatusPurged DeviceStatus = "Purged"

	// DeviceStatusUnknown indicates that the device is missing in device status.
	DeviceStatusUnknown DeviceStatus = "Unknown"

	// DeviceStatusChecksumError indicates that the provided config is incorrect since the checksum is not matched.
	DeviceStatusChecksumError DeviceStatus = "ConnectionError"
)

type RolloutPhase

type RolloutPhase string

RolloutPhase are a set of rollout phases.

const (
	// RolloutPhaseHealthy indicates a rollout is healthy.
	RolloutPhaseHealthy RolloutPhase = "Healthy"
	// RolloutPhaseRollback indicates a rollout is degraded and under rollback.
	RolloutPhaseRollback RolloutPhase = "Rollback"
)

type RolloutStatus

type RolloutStatus string

RolloutStatus are a set of rollout progress.

const (
	// RolloutStatusCompleted indicates a transaction is completed.
	RolloutStatusCompleted RolloutStatus = "Completed"

	// RolloutStatusRunning indicates that a transaction is in progress.
	RolloutStatusRunning RolloutStatus = "Running"

	// RolloutStatusFailed indicates that a transaction is failed and stopped.
	// Manual recover is needed to start next transaction.
	RolloutStatusFailed RolloutStatus = "Failed"
)

Jump to

Keyboard shortcuts

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