v1beta1

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Overview

Package v1beta1 contains API Schema definitions for the kudo v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/kudobuilder/kudo/pkg/apis/kudo +k8s:defaulter-gen=TypeMeta +groupName=kudo.dev

Package v1beta1 contains API Schema definitions for the kudo v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/kudobuilder/kudo/pkg/apis/kudo +k8s:defaulter-gen=TypeMeta +groupName=kudo.dev

Index

Constants

View Source
const (
	// ExecutionInProgress actively deploying, but not yet healthy.
	ExecutionInProgress ExecutionStatus = "IN_PROGRESS"

	// ExecutionPending Not ready to deploy because dependent phases/steps not healthy.
	ExecutionPending ExecutionStatus = "PENDING"

	// ExecutionComplete deployed and healthy.
	ExecutionComplete ExecutionStatus = "COMPLETE"

	// ErrorStatus there was an error deploying the application.
	ErrorStatus ExecutionStatus = "ERROR"

	// ExecutionFatalError there was an error deploying the application.
	ExecutionFatalError ExecutionStatus = "FATAL_ERROR"

	// ExecutionNeverRun is used when this plan/phase/step was never run so far
	ExecutionNeverRun ExecutionStatus = "NEVER_RUN"

	// DeployPlanName is the name of the deployment plan
	DeployPlanName = "deploy"

	// UpgradePlanName is the name of the upgrade plan
	UpgradePlanName = "upgrade"

	// UpdatePlanName is the name of the update plan
	UpdatePlanName = "update"

	// CleanupPlanName is the name of the cleanup plan
	CleanupPlanName = "cleanup"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "kudo.dev", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme is required by pkg/client/...
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func CleanupPlanExists added in v0.11.0

func CleanupPlanExists(ov *OperatorVersion) bool

func OperatorInstanceName added in v0.14.0

func OperatorInstanceName(operatorName string) string

func OperatorVersionName added in v0.14.0

func OperatorVersionName(operatorName, appVersion, opVersion string) string

func ParameterDiff added in v0.10.1

func ParameterDiff(old, new map[string]string) map[string]string

ParameterDiff returns map containing all parameters that were removed or changed between old and new

func PlanExists added in v0.11.0

func PlanExists(plan string, ov *OperatorVersion) bool

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

func RichParameterDiff added in v0.12.0

func RichParameterDiff(old, new map[string]string) (changed, removed map[string]string)

RichParameterDiff compares new and old map and returns two maps: first containing all changed/added and second all removed parameters.

func SelectPlan added in v0.10.1

func SelectPlan(possiblePlans []string, ov *OperatorVersion) *string

SelectPlan returns nil if none of the plan exists, otherwise the first one in list that exists

func ToSortableOperatorList added in v0.17.0

func ToSortableOperatorList(ovList []OperatorVersion) kudo.SortableOperatorList

func ValidateParameterValueForEnum added in v0.17.0

func ValidateParameterValueForEnum(enumValues []string, pValue interface{}) error

func ValidateParameterValueForType added in v0.17.0

func ValidateParameterValueForType(pType ParameterType, pValue interface{}) error

Types

type DummyTaskSpec

type DummyTaskSpec struct {
	// +optional
	WantErr bool `json:"wantErr,omitempty"`
	// +optional
	Fatal bool `json:"fatal,omitempty"`
	// +optional
	Done bool `json:"done,omitempty"`
}

DummyTaskSpec can succeed or fail on demand and is very useful for testing operators

func (*DummyTaskSpec) DeepCopy

func (in *DummyTaskSpec) DeepCopy() *DummyTaskSpec

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

func (*DummyTaskSpec) DeepCopyInto

func (in *DummyTaskSpec) DeepCopyInto(out *DummyTaskSpec)

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

type ExecutionStatus

type ExecutionStatus string

ExecutionStatus captures the state of the rollout.

func (ExecutionStatus) IsFinished

func (s ExecutionStatus) IsFinished() bool

IsFinished returns true if the status is complete successfully (not in 'FATAL_ERROR' state)

func (ExecutionStatus) IsRunning

func (s ExecutionStatus) IsRunning() bool

IsRunning returns true if the plan is currently being executed

func (ExecutionStatus) IsTerminal

func (s ExecutionStatus) IsTerminal() bool

IsTerminal returns true if the status is terminal (either complete, or in a fatal error)

type Instance

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

	Spec   InstanceSpec   `json:"spec,omitempty"`
	Status InstanceStatus `json:"status,omitempty"`
}

Instance is the Schema for the instances API. +k8s:openapi-gen=true +kubebuilder:subresource:status

func GetInstance added in v0.15.0

func GetInstance(namespacedName types.NamespacedName, c client.Client) (i *Instance, err error)

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

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

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

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

func (*Instance) DeepCopyObject

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

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

func (*Instance) GetLastExecutedPlanStatus

func (i *Instance) GetLastExecutedPlanStatus() *PlanStatus

GetLastExecutedPlanStatus returns status of plan that is currently running, if there is one running if no plan is running it looks for last executed plan based on timestamps

func (*Instance) GetOperatorVersion added in v0.14.0

func (i *Instance) GetOperatorVersion(c client.Reader) (ov *OperatorVersion, err error)

GetOperatorVersion retrieves OperatorVersion belonging to the given instance

func (*Instance) GetPlanInProgress

func (i *Instance) GetPlanInProgress() *PlanStatus

GetPlanInProgress returns plan status of currently active plan or nil if no plan is running

func (*Instance) HasCleanupFinalizer added in v0.11.0

func (i *Instance) HasCleanupFinalizer() bool

func (*Instance) HasNoFinalizers added in v0.11.0

func (i *Instance) HasNoFinalizers() bool

func (*Instance) IsChildInstance added in v0.15.0

func (i *Instance) IsChildInstance() bool

IsChildInstance method return true if this instance is owned by another instance (as a dependency) and false otherwise. If there is any owner with the same kind 'Instance' then this Instance is owned by another one.

func (*Instance) IsDeleting added in v0.9.0

func (i *Instance) IsDeleting() bool

IsDeleting returns true is the instance is being deleted.

func (*Instance) IsTopLevelInstance added in v0.15.0

func (i *Instance) IsTopLevelInstance() bool

func (*Instance) NoPlanEverExecuted

func (i *Instance) NoPlanEverExecuted() bool

NoPlanEverExecuted returns true is this is new instance for which we never executed any plan

func (*Instance) OperatorVersionNamespace

func (i *Instance) OperatorVersionNamespace() string

OperatorVersionNamespace returns the namespace of the OperatorVersion that the Instance references.

func (*Instance) PlanStatus added in v0.9.0

func (i *Instance) PlanStatus(plan string) *PlanStatus

func (*Instance) ResetPlanStatus added in v0.10.1

func (i *Instance) ResetPlanStatus(ps *PlanStatus, uid types.UID, updatedTimestamp *metav1.Time)

ResetPlanStatus method resets a PlanStatus for a passed plan name and instance. Plan/phase/step statuses are set to ExecutionPending meaning that the controller will restart plan execution.

func (*Instance) SetReadiness added in v0.17.0

func (i *Instance) SetReadiness(reason ReadinessType, msg string)

func (*Instance) TryAddFinalizer added in v0.9.0

func (i *Instance) TryAddFinalizer() bool

TryAddFinalizer adds the cleanup finalizer to an instance if the finalizer hasn't been added yet, the instance has a cleanup plan and the cleanup plan didn't run yet. Returns true if the cleanup finalizer has been added.

func (*Instance) TryRemoveFinalizer added in v0.9.0

func (i *Instance) TryRemoveFinalizer() bool

TryRemoveFinalizer removes the cleanup finalizer of an instance if it has been added, the instance has a cleanup plan and the cleanup plan *successfully* finished. Returns true if the cleanup finalizer has been removed.

func (*Instance) UpdateInstanceStatus

func (i *Instance) UpdateInstanceStatus(ps *PlanStatus, updatedTimestamp *metav1.Time)

UpdateInstanceStatus updates `Status.PlanStatus` and `Status.AggregatedStatus` property based on the given plan also updates Ready condition for finished plans

type InstanceList

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

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object InstanceList contains a list of Instance.

func (*InstanceList) DeepCopy

func (in *InstanceList) DeepCopy() *InstanceList

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

func (*InstanceList) DeepCopyInto

func (in *InstanceList) DeepCopyInto(out *InstanceList)

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

func (*InstanceList) DeepCopyObject

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

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

type InstanceSpec

type InstanceSpec struct {
	// OperatorVersion specifies a reference to a specific OperatorVersion object.
	OperatorVersion corev1.ObjectReference `json:"operatorVersion,omitempty"`

	Parameters map[string]string `json:"parameters,omitempty"`

	PlanExecution PlanExecution `json:"planExecution,omitempty"`
}

InstanceSpec defines the desired state of Instance.

func (*InstanceSpec) DeepCopy

func (in *InstanceSpec) DeepCopy() *InstanceSpec

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

func (*InstanceSpec) DeepCopyInto

func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec)

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

type InstanceStatus

type InstanceStatus struct {
	// slice would be enough here but we cannot use slice because order of sequence in yaml is considered significant while here it's not
	PlanStatus map[string]PlanStatus `json:"planStatus,omitempty"`
	Conditions []metav1.Condition    `json:"conditions,omitempty"`
}

InstanceStatus defines the observed state of Instance

func (*InstanceStatus) DeepCopy

func (in *InstanceStatus) DeepCopy() *InstanceStatus

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

func (*InstanceStatus) DeepCopyInto

func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus)

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

type KudoOperatorTaskSpec added in v0.14.0

type KudoOperatorTaskSpec struct {
	// either repo package name, local package folder or an URL to package tarball. during operator installation,
	// kudoctl will resolve the package and override this field with the resolved operator name.
	// +optional
	Package string `json:"package,omitempty"`
	// +optional
	InstanceName string `json:"instanceName,omitempty"`
	// a specific app version in the official repo, defaults to the most recent
	// +optional
	AppVersion string `json:"appVersion,omitempty"`
	// a specific operator version in the official repo, defaults to the most recent one
	// +optional
	OperatorVersion string `json:"operatorVersion,omitempty"`
	// name of the template file (located in the `templates` folder) from which the *parent* instance
	// generates a parameter file used to populate the *child* Instance.Spec.Parameters
	// +optional
	ParameterFile string `json:"parameterFile,omitempty"`
}

KudoOperatorSpec specifies how a KUDO operator is installed

func (*KudoOperatorTaskSpec) DeepCopy added in v0.14.0

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

func (*KudoOperatorTaskSpec) DeepCopyInto added in v0.14.0

func (in *KudoOperatorTaskSpec) DeepCopyInto(out *KudoOperatorTaskSpec)

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

type Maintainer

type Maintainer struct {
	// Name is a user name or organization name.
	Name string `json:"name,omitempty"`

	// Email is an optional email address to contact the named maintainer.
	Email string `json:"email,omitempty"`
}

Maintainer describes an Operator maintainer.

func (*Maintainer) DeepCopy

func (in *Maintainer) DeepCopy() *Maintainer

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

func (*Maintainer) DeepCopyInto

func (in *Maintainer) DeepCopyInto(out *Maintainer)

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

type Operator

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

	Spec   OperatorSpec   `json:"spec,omitempty"`
	Status OperatorStatus `json:"status,omitempty"`
}

Operator is the Schema for the operator API +k8s:openapi-gen=true

func GetOperator added in v0.15.0

func GetOperator(name, ns string, c client.Client) (*Operator, error)

func (*Operator) DeepCopy

func (in *Operator) DeepCopy() *Operator

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

func (*Operator) DeepCopyInto

func (in *Operator) DeepCopyInto(out *Operator)

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

func (*Operator) DeepCopyObject

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

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

type OperatorList

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

OperatorList contains a list of Operator

func (*OperatorList) DeepCopy

func (in *OperatorList) DeepCopy() *OperatorList

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

func (*OperatorList) DeepCopyInto

func (in *OperatorList) DeepCopyInto(out *OperatorList)

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

func (*OperatorList) DeepCopyObject

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

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

type OperatorSpec

type OperatorSpec struct {
	Description       string        `json:"description,omitempty"`
	KudoVersion       string        `json:"kudoVersion,omitempty"`
	KubernetesVersion string        `json:"kubernetesVersion,omitempty"`
	Maintainers       []*Maintainer `json:"maintainers,omitempty"`
	URL               string        `json:"url,omitempty"`
	NamespaceManifest string        `json:"namespaceManifest,omitempty"`
}

OperatorSpec defines the desired state of Operator

func (*OperatorSpec) DeepCopy

func (in *OperatorSpec) DeepCopy() *OperatorSpec

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

func (*OperatorSpec) DeepCopyInto

func (in *OperatorSpec) DeepCopyInto(out *OperatorSpec)

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

type OperatorStatus

type OperatorStatus struct {
}

OperatorStatus defines the observed state of Operator

func (*OperatorStatus) DeepCopy

func (in *OperatorStatus) DeepCopy() *OperatorStatus

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

func (*OperatorStatus) DeepCopyInto

func (in *OperatorStatus) DeepCopyInto(out *OperatorStatus)

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

type OperatorVersion

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

	Spec   OperatorVersionSpec   `json:"spec,omitempty"`
	Status OperatorVersionStatus `json:"status,omitempty"`
}

OperatorVersion is the Schema for the operatorversions API. +k8s:openapi-gen=true

func GetOperatorVersionByName added in v0.14.0

func GetOperatorVersionByName(name, ns string, c client.Reader) (ov *OperatorVersion, err error)

func (*OperatorVersion) AppVersion added in v0.17.0

func (ov *OperatorVersion) AppVersion() string

func (*OperatorVersion) DeepCopy

func (in *OperatorVersion) DeepCopy() *OperatorVersion

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

func (*OperatorVersion) DeepCopyInto

func (in *OperatorVersion) DeepCopyInto(out *OperatorVersion)

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

func (*OperatorVersion) DeepCopyObject

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

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

func (*OperatorVersion) EqualOperatorVersion added in v0.15.0

func (ov *OperatorVersion) EqualOperatorVersion(other *OperatorVersion) bool

func (*OperatorVersion) FullyQualifiedName added in v0.15.0

func (ov *OperatorVersion) FullyQualifiedName() string

func (*OperatorVersion) OperatorName added in v0.17.0

func (ov *OperatorVersion) OperatorName() string

func (*OperatorVersion) OperatorVersion added in v0.17.0

func (ov *OperatorVersion) OperatorVersion() string

type OperatorVersionList

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

OperatorVersionList contains a list of OperatorVersion.

func ListOperatorVersions added in v0.17.0

func ListOperatorVersions(ns string, c client.Reader) (l *OperatorVersionList, err error)

func (*OperatorVersionList) DeepCopy

func (in *OperatorVersionList) DeepCopy() *OperatorVersionList

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

func (*OperatorVersionList) DeepCopyInto

func (in *OperatorVersionList) DeepCopyInto(out *OperatorVersionList)

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

func (*OperatorVersionList) DeepCopyObject

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

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

type OperatorVersionSpec

type OperatorVersionSpec struct {
	// +optional
	Operator   corev1.ObjectReference `json:"operator,omitempty"`
	Version    string                 `json:"version,omitempty"`
	AppVersion string                 `json:"appVersion,omitempty"`

	// Templates is a list of references to YAML templates located in the templates folder and later referenced from tasks.
	Templates map[string]string `json:"templates,omitempty"`
	// List of all tasks available in this OperatorVersion.
	Tasks []Task `json:"tasks,omitempty"`

	Parameters []Parameter `json:"parameters,omitempty"`

	// Plans maps a plan name to a plan.
	// +nullable
	Plans map[string]Plan `json:"plans,omitempty"`

	// ConnectionString defines a templated string that can be used to connect to an instance of the Operator.
	// +optional
	ConnectionString string `json:"connectionString,omitempty"`

	// UpgradableFrom lists all OperatorVersions that can upgrade to this OperatorVersion.
	UpgradableFrom []corev1.ObjectReference `json:"upgradableFrom,omitempty"`
}

OperatorVersionSpec defines the desired state of OperatorVersion.

func (*OperatorVersionSpec) DeepCopy

func (in *OperatorVersionSpec) DeepCopy() *OperatorVersionSpec

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

func (*OperatorVersionSpec) DeepCopyInto

func (in *OperatorVersionSpec) DeepCopyInto(out *OperatorVersionSpec)

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

type OperatorVersionStatus

type OperatorVersionStatus struct {
}

OperatorVersionStatus defines the observed state of OperatorVersion.

func (*OperatorVersionStatus) DeepCopy

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

func (*OperatorVersionStatus) DeepCopyInto

func (in *OperatorVersionStatus) DeepCopyInto(out *OperatorVersionStatus)

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

type Ordering

type Ordering string

Ordering specifies how the subitems in this plan/phase should be rolled out.

const (
	// Serial specifies that the plans or objects should be created in order. The first should be healthy before
	// continuing on.
	Serial Ordering = "serial"

	// Parallel specifies that the plan or objects in the phase can all be launched at the same time.
	Parallel Ordering = "parallel"
)

type Parameter

type Parameter struct {
	// DisplayName can be used by UIs.
	DisplayName string `json:"displayName,omitempty"`

	// Name is the string that should be used in the template file for example,
	// if `name: COUNT` then using the variable in a spec like:
	//
	// spec:
	//   replicas:  {{ .Params.COUNT }}
	Name string `json:"name,omitempty"`

	// Description captures a longer description of how the parameter will be used.
	Description string `json:"description,omitempty"`

	// Required specifies if the parameter is required to be provided by all instances, or whether a default can suffice.
	Required *bool `json:"required,omitempty"`

	// Default is a default value if no parameter is provided by the instance.
	Default *string `json:"default,omitempty"`

	// Trigger identifies the plan that gets executed when this parameter changes in the Instance object.
	// Default is `update` if a plan with that name exists, otherwise it's `deploy`.
	Trigger string `json:"trigger,omitempty"`

	// Type specifies the value type. Defaults to `string`.
	Type ParameterType `json:"value-type,omitempty"`

	// Specifies if the parameter can be changed after the initial installation of the operator
	Immutable *bool `json:"immutable,omitempty"`

	// Defines a list of allowed values. If Default is set and Enum is not nil, the value must be in this list as well
	Enum *[]string `json:"enum,omitempty"`
}

Parameter captures the variability of an OperatorVersion being instantiated in an instance.

func GetAddedParameters added in v0.16.0

func GetAddedParameters(old, new []Parameter) []Parameter

GetAddedParameters returns a list of parameters that are in newOv but not in oldOv

func GetChangedParamDefs added in v0.16.0

func GetChangedParamDefs(p1, p2 []Parameter, isEqual func(p1, p2 Parameter) bool) []Parameter

GetChangedParamDefs returns a list of parameters from ov2 that changed based on the given compare function between ov1 and ov2

func GetParamDefinitions added in v0.10.1

func GetParamDefinitions(params map[string]string, ov *OperatorVersion) ([]Parameter, error)

GetParamDefinitions retrieves parameter metadata from OperatorVersion but returns an error if any parameter is missing

func GetRemovedParamDefs added in v0.16.0

func GetRemovedParamDefs(old, new []Parameter) []Parameter

GetAddedParameters returns a list of parameters that are in oldOv but not in newOv

func (*Parameter) DeepCopy

func (in *Parameter) DeepCopy() *Parameter

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

func (*Parameter) DeepCopyInto

func (in *Parameter) DeepCopyInto(out *Parameter)

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

func (*Parameter) EnumValues added in v0.17.0

func (p *Parameter) EnumValues() []string

func (*Parameter) HasDefault added in v0.16.0

func (p *Parameter) HasDefault() bool

func (*Parameter) IsEnum added in v0.17.0

func (p *Parameter) IsEnum() bool

func (*Parameter) IsImmutable added in v0.16.0

func (p *Parameter) IsImmutable() bool

func (*Parameter) IsRequired added in v0.16.0

func (p *Parameter) IsRequired() bool

func (*Parameter) ValidateDefault added in v0.17.0

func (p *Parameter) ValidateDefault() error

func (*Parameter) ValidateValue added in v0.17.0

func (p *Parameter) ValidateValue(pValue string) error

ValidateValue ensures that a the given value is valid for this parameter

type ParameterType added in v0.11.0

type ParameterType string

ParameterType specifies the type of a parameter value.

const (
	// StringValueType is used for parameter values that are provided as a string.
	StringValueType ParameterType = "string"

	// IntegerValueType is used for parameter values that describe an integral number without any fractional part
	IntegerValueType ParameterType = "integer"

	// NumberValueType is used for parameter values that describe any numeric value, with or without a fractional part
	NumberValueType ParameterType = "number"

	// BooleanValueType is used for parameter values that are "true" or "false"
	BooleanValueType ParameterType = "boolean"

	// ArrayValueType is used for parameter values that describe an array of values.
	ArrayValueType ParameterType = "array"

	// MapValueType is used for parameter values that describe a mapping type.
	MapValueType ParameterType = "map"
)

type Phase

type Phase struct {
	// +optional
	Name string `json:"name"`
	// +optional
	Strategy Ordering `json:"strategy"`

	// Steps maps a step name to a list of templated Kubernetes objects stored as a string.
	// +optional
	Steps []Step `json:"steps"`
}

Phase specifies a list of steps that contain Kubernetes objects.

func (*Phase) DeepCopy

func (in *Phase) DeepCopy() *Phase

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

func (*Phase) DeepCopyInto

func (in *Phase) DeepCopyInto(out *Phase)

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

type PhaseStatus

type PhaseStatus struct {
	Name    string          `json:"name,omitempty"`
	Status  ExecutionStatus `json:"status,omitempty"`
	Message string          `json:"message,omitempty"` // more verbose explanation of the status, e.g. a detailed error message
	Steps   []StepStatus    `json:"steps,omitempty"`
}

PhaseStatus is representing status of a phase

func GetPhaseStatus added in v0.10.1

func GetPhaseStatus(phaseName string, planStatus *PlanStatus) *PhaseStatus

func (*PhaseStatus) DeepCopy

func (in *PhaseStatus) DeepCopy() *PhaseStatus

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

func (*PhaseStatus) DeepCopyInto

func (in *PhaseStatus) DeepCopyInto(out *PhaseStatus)

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

func (*PhaseStatus) Set added in v0.9.0

func (s *PhaseStatus) Set(status ExecutionStatus)

func (*PhaseStatus) SetWithMessage added in v0.9.0

func (s *PhaseStatus) SetWithMessage(status ExecutionStatus, message string)

func (*PhaseStatus) Step added in v0.17.3

func (s *PhaseStatus) Step(name string) *StepStatus

Step returns the StepStatus with the given name, or nil if no such step status exists

type PipeSpec added in v0.9.0

type PipeSpec struct {
	// +optional
	File string `json:"file"`
	// +optional
	EnvFile string `json:"envFile"`
	// +optional
	Kind string `json:"kind"`
	// +optional
	Key string `json:"key"`
}

PipeSpec describes how a file generated by a PipeTask is stored and referenced

func (*PipeSpec) DeepCopy added in v0.9.0

func (in *PipeSpec) DeepCopy() *PipeSpec

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

func (*PipeSpec) DeepCopyInto added in v0.9.0

func (in *PipeSpec) DeepCopyInto(out *PipeSpec)

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

type PipeTaskSpec added in v0.9.0

type PipeTaskSpec struct {
	// +optional
	Pod string `json:"pod,omitempty"`
	// +optional
	// +nullable
	Pipe []PipeSpec `json:"pipe,omitempty"`
}

PipeTask specifies a task that generates files and stores them for later usage in subsequent tasks

func (*PipeTaskSpec) DeepCopy added in v0.9.0

func (in *PipeTaskSpec) DeepCopy() *PipeTaskSpec

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

func (*PipeTaskSpec) DeepCopyInto added in v0.9.0

func (in *PipeTaskSpec) DeepCopyInto(out *PipeTaskSpec)

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

type Plan

type Plan struct {
	// +optional
	Strategy Ordering `json:"strategy"`
	// Phases maps a phase name to a Phase object.
	// +optional
	// +nullable
	Phases []Phase `json:"phases"`
}

Plan specifies a series of Phases that need to be completed.

func (*Plan) DeepCopy

func (in *Plan) DeepCopy() *Plan

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

func (*Plan) DeepCopyInto

func (in *Plan) DeepCopyInto(out *Plan)

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

type PlanExecution added in v0.10.1

type PlanExecution struct {
	PlanName string                `json:"planName,omitempty"`
	UID      apimachinerytypes.UID `json:"uid,omitempty"`
	Status   ExecutionStatus       `json:"status,omitempty"`
}

There are two ways a plan execution can be triggered:

  1. indirectly through update of a corresponding parameter in the InstanceSpec.Parameters map
  2. directly through setting of the InstanceSpec.PlanExecution.PlanName field

While indirect (1) triggers happens every time a user changes a parameter, a directly (2) triggered plan is reserved for the situations when parameters doesn't change e.g. a periodic backup is triggered overriding the existing backup file. Additionally, this opens room for canceling and overriding currently running plans in the future. Note: PlanExecution field defines plan name and corresponding parameters that IS CURRENTLY executed. Once the instance controller (IC) is done with the execution, this field will be cleared. Each plan execution has a unique UID so should the same plan be re-triggered it will have a new UID

func (*PlanExecution) DeepCopy added in v0.10.1

func (in *PlanExecution) DeepCopy() *PlanExecution

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

func (*PlanExecution) DeepCopyInto added in v0.10.1

func (in *PlanExecution) DeepCopyInto(out *PlanExecution)

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

type PlanStatus

type PlanStatus struct {
	Name    string          `json:"name,omitempty"`
	Status  ExecutionStatus `json:"status,omitempty"`
	Message string          `json:"message,omitempty"` // more verbose explanation of the status, e.g. a detailed error message
	// +nullable
	LastUpdatedTimestamp *metav1.Time          `json:"lastUpdatedTimestamp,omitempty"`
	Phases               []PhaseStatus         `json:"phases,omitempty"`
	UID                  apimachinerytypes.UID `json:"uid,omitempty"`
}

PlanStatus is representing status of a plan

These are valid states and transitions

+----------------+
| Never executed |
+-------+--------+
        |
        v

+-------------+ +-------+--------+ | Error |<------>| Pending | +------+------+ +-------+--------+

^                       |
|                       v
|               +-------+--------+
+-------------->|  In progress   |
|               +-------+--------+
|                       |
v                       v

+------+------+ +-------+--------+ | Fatal error | | Complete | +-------------+ +----------------+

func (*PlanStatus) DeepCopy

func (in *PlanStatus) DeepCopy() *PlanStatus

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

func (*PlanStatus) DeepCopyInto

func (in *PlanStatus) DeepCopyInto(out *PlanStatus)

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

func (*PlanStatus) Phase added in v0.17.3

func (s *PlanStatus) Phase(name string) *PhaseStatus

Step returns the PhaseStatus with the given name, or nil if no such phase status exists

func (*PlanStatus) Set added in v0.9.0

func (s *PlanStatus) Set(status ExecutionStatus)

func (*PlanStatus) SetWithMessage added in v0.9.0

func (s *PlanStatus) SetWithMessage(status ExecutionStatus, message string)

type ReadinessType added in v0.17.0

type ReadinessType string
const (
	ReadinessPlanInProgress   ReadinessType = "PlanInProgress"
	ReadinessPlanInFatalError ReadinessType = "PlanInFatalError"
	ReadinessResourceNotReady ReadinessType = "ResourceNotReady"
	ReadinessResourcesReady   ReadinessType = "ResourcesReady"
)

type ResourceTaskSpec

type ResourceTaskSpec struct {
	// +optional
	// +nullable
	Resources []string `json:"resources,omitempty"`
}

ResourceTaskSpec is referencing a list of resources

func (*ResourceTaskSpec) DeepCopy

func (in *ResourceTaskSpec) DeepCopy() *ResourceTaskSpec

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

func (*ResourceTaskSpec) DeepCopyInto

func (in *ResourceTaskSpec) DeepCopyInto(out *ResourceTaskSpec)

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

type Step

type Step struct {
	// +optional
	Name string `json:"name"`
	// +optional
	Tasks []string `json:"tasks"`
}

Step defines a specific set of operations that occur.

func (*Step) DeepCopy

func (in *Step) DeepCopy() *Step

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

func (*Step) DeepCopyInto

func (in *Step) DeepCopyInto(out *Step)

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

type StepStatus

type StepStatus struct {
	Name    string          `json:"name,omitempty"`
	Message string          `json:"message,omitempty"` // more verbose explanation of the status, e.g. a detailed error message
	Status  ExecutionStatus `json:"status,omitempty"`
}

StepStatus is representing status of a step

func GetStepStatus added in v0.10.1

func GetStepStatus(stepName string, phaseStatus *PhaseStatus) *StepStatus

func (*StepStatus) DeepCopy

func (in *StepStatus) DeepCopy() *StepStatus

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

func (*StepStatus) DeepCopyInto

func (in *StepStatus) DeepCopyInto(out *StepStatus)

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

func (*StepStatus) Set added in v0.9.0

func (s *StepStatus) Set(status ExecutionStatus)

func (*StepStatus) SetWithMessage added in v0.9.0

func (s *StepStatus) SetWithMessage(status ExecutionStatus, message string)

type Task

type Task struct {
	// +optional
	Name string `json:"name"`
	// +optional
	Kind string `json:"kind"`
	// +optional
	Spec TaskSpec `json:"spec"`
}

Task is a global, polymorphic implementation of all publicly available tasks

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

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

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

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

type TaskSpec

type TaskSpec struct {
	ResourceTaskSpec     `json:",inline"`
	DummyTaskSpec        `json:",inline"`
	PipeTaskSpec         `json:",inline"`
	ToggleTaskSpec       `json:",inline"`
	KudoOperatorTaskSpec `json:",inline"`
}

TaskSpec embeds all possible task specs. This allows us to avoid writing custom un/marshallers that would only parse certain fields depending on the task Kind. The downside of this approach is, that embedded types can not have fields with the same json names as it would become ambiguous for the default parser. We might revisit this approach in the future should this become an issue.

func (*TaskSpec) DeepCopy

func (in *TaskSpec) DeepCopy() *TaskSpec

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

func (*TaskSpec) DeepCopyInto

func (in *TaskSpec) DeepCopyInto(out *TaskSpec)

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

type ToggleTaskSpec added in v0.11.0

type ToggleTaskSpec struct {
	// +optional
	Parameter string `json:"parameter,omitempty"`
}

ToggleTaskSpec is referencing a ResourceTaskSpec and a parameter

func (*ToggleTaskSpec) DeepCopy added in v0.11.0

func (in *ToggleTaskSpec) DeepCopy() *ToggleTaskSpec

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

func (*ToggleTaskSpec) DeepCopyInto added in v0.11.0

func (in *ToggleTaskSpec) DeepCopyInto(out *ToggleTaskSpec)

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