v1alpha1

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 +groupName=blackstart.pezops.github.io

Index

Constants

View Source
const GroupName = "blackstart.pezops.github.io"
View Source
const GroupVersion = "v1alpha1"

Variables

View Source
var (
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion}
	SchemeBuilder      = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme        = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type FromDependency

type FromDependency struct {
	// Id is the identifier of the operation to get the output value from.
	// +kubebuilder:validation:Required
	Id string `yaml:"id" json:"id"`

	// Output is the key used for the output value from a previously-ran dependency operation to
	// use as the input value for the current operation. This may include non-scalar values.
	// +kubebuilder:validation:Required
	Output string `yaml:"output" json:"output"`
}

FromDependency models a dynamic input from the output of a different operation. +kubebuilder:object:generate=true

func (*FromDependency) DeepCopy

func (in *FromDependency) DeepCopy() *FromDependency

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

func (*FromDependency) DeepCopyInto

func (in *FromDependency) DeepCopyInto(out *FromDependency)

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

type Operation

type Operation struct {
	// Short name for the operation.
	Name string `yaml:"name,omitempty" json:"name,omitempty"`

	// Long-form description of the operation.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`

	// Identifier for the Operation, used by other operations to reference for dependencies.
	// +kubebuilder:validation:Required
	Id string `yaml:"id" json:"id"`

	// Module to be instantiated for the Operation. This must match the identifier of a registered
	// module.
	// +kubebuilder:validation:Required
	Module string `yaml:"module" json:"module"`

	// Inputs may be a key:value object mapping a set of static, scalar values to a named input
	// for the selected module. Instead of a scalar value, it may also be a well-known object with
	// the `fromDependency` property. The `fromDependency` must contain both an `id` and `output`
	// property to indicate which operation and output value to use as a dynamic input value that
	// is filled at runtime.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Inputs map[string]*OperationInput `yaml:"inputs,omitempty" json:"inputs,omitempty"`

	// DependsOn is a list of operation IDs that this operation depends on and must be completed
	// before this operation is run.
	DependsOn []string `yaml:"dependsOn,omitempty" json:"dependsOn,omitempty"`

	// DoesNotExist is a special parameter that can be used to indicate that the resource should
	// not exist. This is useful for resources that are changed from a previous state and now
	// should be deleted if they still exist.
	DoesNotExist bool `yaml:"doesNotExist,omitempty" json:"doesNotExist,omitempty"`

	// Tainted is a special parameter that can be used to indicate that the resource is tainted and
	// should be replaced. This is useful for resources that always must be updated so that
	// attributes / output values are known by blackstart. This should not be configured by users,
	// and should only be used explicitly by modules.
	Tainted bool `yaml:"tainted,omitempty" json:"tainted,omitempty"`
}

Operation models a single Blackstart operation in the Workflow. +kubebuilder:object:generate=true

func (*Operation) DeepCopy

func (in *Operation) DeepCopy() *Operation

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

func (*Operation) DeepCopyInto

func (in *Operation) DeepCopyInto(out *Operation)

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

type OperationInput

type OperationInput struct {
	// FromDependency indicates that the input value should be taken from the output of a different
	// operation.
	FromDependency *FromDependency `yaml:"fromDependency,omitempty" json:"fromDependency,omitempty"`

	// Extra holds any additional fields not explicitly modeled in the struct. This should be a
	// map of scalar values.
	Extra *apiextensionsv1.JSON `yaml:"-" json:"-"`
}

OperationInput is a single input value for an operation. Inputs may either be static or dynamic (from a dependency) using the output of a different operation. +kubebuilder:object:generate=true

func (*OperationInput) DeepCopy

func (in *OperationInput) DeepCopy() *OperationInput

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

func (*OperationInput) DeepCopyInto

func (in *OperationInput) DeepCopyInto(out *OperationInput)

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

func (*OperationInput) UnmarshalJSON

func (oi *OperationInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshalling for OperationInput

func (*OperationInput) UnmarshalYAML

func (oi *OperationInput) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshalling for OperationInput

type Workflow

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

	Spec   WorkflowSpec   `json:"spec,omitempty"`
	Status WorkflowStatus `json:"status,omitempty"`
}

Workflow defines all the settings for a Blackstart workflow including its operations and their dependencies. +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:path=workflows,scope=Namespaced,shortName=bswf +kubebuilder:storageversion +kubebuilder:printcolumn:name="Successful",type=string,JSONPath=".status.successful" +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=".status.phase" +kubebuilder:printcolumn:name="Operations",type=string,JSONPath=`.status.operationsCompleted` +kubebuilder:printcolumn:name="Last Ran",type=date,JSONPath=`.status.lastRan` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*Workflow) DeepCopy

func (in *Workflow) DeepCopy() *Workflow

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

func (*Workflow) DeepCopyInto

func (in *Workflow) DeepCopyInto(out *Workflow)

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

func (*Workflow) DeepCopyObject

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

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

type WorkflowConfigFile

type WorkflowConfigFile struct {
	WorkflowSpec `yaml:",inline"`
	Name         string `yaml:"name" json:"name"`
}

WorkflowConfigFile models a workflow as defined in a standalone YAML configuration file.

type WorkflowList

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

WorkflowList contains a list of Workflow resources +kubebuilder:object:root=true

func (*WorkflowList) DeepCopy

func (in *WorkflowList) DeepCopy() *WorkflowList

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

func (*WorkflowList) DeepCopyInto

func (in *WorkflowList) DeepCopyInto(out *WorkflowList)

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

func (*WorkflowList) DeepCopyObject

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

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

type WorkflowSpec

type WorkflowSpec struct {
	// Optional human description
	Description string `yaml:"description,omitempty" json:"description,omitempty"`

	// ReconcileInterval controls how often this Workflow should be reconciled when running in
	// controller mode. If not set, the default is 5m.
	// +kubebuilder:default:="5m"
	ReconcileInterval string `yaml:"reconcileInterval,omitempty" json:"reconcileInterval,omitempty"`

	// A partially ordered set of operations to be executed.
	// +kubebuilder:validation:MinItems=1
	Operations []Operation `yaml:"operations" json:"operations"`
}

WorkflowSpec models the spec section of the Workflow, the actual values used by Blackstart. +kubebuilder:object:generate=true

func (*WorkflowSpec) DeepCopy

func (in *WorkflowSpec) DeepCopy() *WorkflowSpec

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

func (*WorkflowSpec) DeepCopyInto

func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec)

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

type WorkflowStatus

type WorkflowStatus struct {
	// LastRan is the time the Workflow was last run, if ever.
	LastRan metav1.Time `json:"lastRan,omitempty"`

	// NextRun is the next scheduled run time for this Workflow in controller mode.
	NextRun metav1.Time `json:"nextRun,omitempty"`

	// Successful indicates whether the last run was successful.
	Successful string `json:"successful,omitempty"`

	// Phase is a high-level state of the workflow that the last run ended in.
	Phase string `json:"phase,omitempty"`

	// Result contains any result information from the last run, including error messages if
	// applicable.
	Result string `json:"result,omitempty"`

	// LastError is a short summary of the most recent error, if the last run failed.
	LastError string `json:"lastError,omitempty"`

	// OperationsCompleted is the number of operations that were completed in the last run. This
	// is stored in a fraction format where the denominator is the total number of operations in
	// the Workflow.
	OperationsCompleted string `json:"operationsCompleted,omitempty"`

	// LastOperation is the identifier of the last operation that was executed in the last run.
	LastOperation string `json:"lastOperation,omitempty"`
}

WorkflowStatus contains runtime status and result information about the Workflow. +kubebuilder:object:generate=true

func (*WorkflowStatus) DeepCopy

func (in *WorkflowStatus) DeepCopy() *WorkflowStatus

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

func (*WorkflowStatus) DeepCopyInto

func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus)

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