v1

package
v0.5.22 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 37

Documentation

Overview

Package v1 contains core API types used by most ndd resources. +kubebuilder:object:generate=true

Index

Constants

View Source
const LabelKeyTargetName = "ndd.yndd.io/target"

LabelKeyTargetName is added to TargetUsages to relate them to their Target.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Type of this condition. At most one of each condition type may apply to
	// a resource at any point in time.
	Kind ConditionKind `json:"kind"`

	// Status of this condition; is it currently True, False, or Unknown?
	Status corev1.ConditionStatus `json:"status"`

	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`

	// A Reason for this condition's last transition from one status to another.
	Reason ConditionReason `json:"reason"`

	// A Message containing details about this condition's last transition from
	// one status to another, if any.
	// +optional
	Message string `json:"message,omitempty"`
}

A Condition that may apply to a resource

func Available

func Available() Condition

Available returns a condition that indicates the resource is currently observed to be available for use.

func Creating

func Creating() Condition

Creating returns a condition that indicates the resource is currently being created.

func Deleting

func Deleting() Condition

Deleting returns a condition that indicates the resource is currently being deleted.

func Failed added in v0.2.9

func Failed(msg string) Condition

Failed returns a condition that indicates the resource failed to get instantiated.

func Pending added in v0.2.23

func Pending() Condition

Pending returns a condition that indicates the resource is not currently available for use and is still being processed

func ReconcileError

func ReconcileError(err error) Condition

ReconcileError returns a condition indicating that ndd encountered an error while reconciling the resource. This could mean ndd was unable to update the resource to reflect its desired state, or that ndd was unable to determine the current actual state of the resource.

func ReconcileSuccess

func ReconcileSuccess() Condition

ReconcileSuccess returns a condition indicating that ndd successfully completed the most recent reconciliation of the resource.

func RootPathValidationFailure added in v0.3.0

func RootPathValidationFailure() Condition

LeafRefValidationFailure returns a condition that indicates the resource leafreference(s) are missing

func RootPathValidationSuccess added in v0.3.0

func RootPathValidationSuccess() Condition

LeafRefValidationSuccess returns a condition that indicates the resource leafreference(s) are found or no leafrefs exist

func RootPathValidationUnknown added in v0.3.0

func RootPathValidationUnknown() Condition

LeafRefValidationUnknown returns a condition that indicates the internal leafref validation is unknown

func TargetFound

func TargetFound() Condition

TargetFound returns a condition that indicates the resource has target(s) available for use.

func TargetNotFound

func TargetNotFound() Condition

TargetNotFound returns a condition that indicates the resource has no target(s) available for use.

func Unavailable

func Unavailable() Condition

Unavailable returns a condition that indicates the resource is not currently available for use. Unavailable should be set only when ndd expects the resource to be available but knows it is not, for example because its API reports it is unhealthy.

func Unknown

func Unknown() Condition

Unknown returns a condition that indicates the resource is in an unknown status.

func Updating

func Updating() Condition

Updating returns a condition that indicates the resource is currently being updated.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

func (Condition) Equal

func (c Condition) Equal(other Condition) bool

Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.

func (Condition) WithMessage

func (c Condition) WithMessage(msg string) Condition

WithMessage returns a condition by adding the provided message to existing condition.

type ConditionKind

type ConditionKind string

A ConditionKind represents a condition kind for a resource

const (
	// handled per resource
	ConditionKindRootPath ConditionKind = "RootPath"
	// handled per resource
	ConditionKindTarget ConditionKind = "TargetFound"
	// handled per target per resource
	ConditionKindSynced ConditionKind = "Synced"
	// handled per target per resource
	ConditionKindReady ConditionKind = "Ready"
)

Condition Kinds.

type ConditionReason

type ConditionReason string

A ConditionReason represents the reason a resource is in a condition.

const (
	ConditionReasonSuccess ConditionReason = "Success"
	ConditionReasonFailed  ConditionReason = "Failed"
)

Reasons a resource validation is or is not ok applicable to leafref validation and target validation

const (
	ConditionReasonUnknown     ConditionReason = "Unknown"
	ConditionReasonCreating    ConditionReason = "Creating"
	ConditionReasonDeleting    ConditionReason = "Deleting"
	ConditionReasonUpdating    ConditionReason = "Updating"
	ConditionReasonUnavailable ConditionReason = "UnAvailable"
	ConditionReasonAvailable   ConditionReason = "Available"
	ConditionReasonPending     ConditionReason = "Pending"
)

Reasons a resource is or is not ready

const (
	ConditionReasonReconcileSuccess ConditionReason = "ReconcileSuccess"
	ConditionReasonReconcileFailure ConditionReason = "ReconcileFailure"
)

Reasons a resource is or is not synced.

type ConditionedStatus

type ConditionedStatus struct {
	// Conditions of the resource.
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
}

A ConditionedStatus reflects the observed status of a resource. Only one condition of each kind may exist.

func NewConditionedStatus

func NewConditionedStatus(c ...Condition) *ConditionedStatus

NewConditionedStatus returns a stat with the supplied conditions set.

func (*ConditionedStatus) DeepCopy

func (in *ConditionedStatus) DeepCopy() *ConditionedStatus

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

func (*ConditionedStatus) DeepCopyInto

func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus)

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

func (*ConditionedStatus) Equal

func (s *ConditionedStatus) Equal(other *ConditionedStatus) bool

Equal returns true if the status is identical to the supplied status, ignoring the LastTransitionTimes and order of statuses.

func (*ConditionedStatus) GetCondition

func (s *ConditionedStatus) GetCondition(ck ConditionKind) Condition

GetCondition returns the condition for the given ConditionKind if exists, otherwise returns nil

func (*ConditionedStatus) SetConditions

func (s *ConditionedStatus) SetConditions(c ...Condition)

SetConditions sets the supplied conditions, replacing any existing conditions of the same kind. This is a no-op if all supplied conditions are identical, ignoring the last transition time, to those already set.

type DeletionPolicy

type DeletionPolicy string

A DeletionPolicy determines what should happen to the underlying external resource when a managed resource is deleted.

const (
	// DeletionOrphan means the external resource will orphaned when its managed
	// resource is deleted.
	DeletionOrphan DeletionPolicy = "orphan"

	// DeletionDelete means both the  external resource will be deleted when its
	// managed resource is deleted.
	DeletionDelete DeletionPolicy = "delete"
)

type DeploymentPolicy added in v0.3.4

type DeploymentPolicy string

A DeploymentPolicy determines what should happen to the underlying external resource when a managed resource is deployed.

const (
	// DeploymentActive means the external resource will deployed
	DeploymentActive DeploymentPolicy = "active"

	// DeploymentPlanned means the resource identifier will be allocated but not deployed
	DeploymentPlanned DeploymentPolicy = "planned"
)

type HealthCondition added in v0.5.9

type HealthCondition struct {
	// Kind of this condition. At most one of each condition kind may apply to
	// a resource at any point in time.
	ResourceName string `json:"resourceName"`

	HealthKind string `json:"healthKind"`

	// Status of this condition; is it currently True, False, or Unknown?
	Status corev1.ConditionStatus `json:"status"`

	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`

	// A Reason for this condition's last transition from one status to another.
	Reason string `json:"reason,omitempty"`

	// A Message containing details about this condition's last transition from
	// one status to another, if any.
	// +optional
	Message string `json:"message,omitempty"`
}

func (*HealthCondition) DeepCopy added in v0.5.9

func (in *HealthCondition) DeepCopy() *HealthCondition

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

func (*HealthCondition) DeepCopyInto added in v0.5.9

func (in *HealthCondition) DeepCopyInto(out *HealthCondition)

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

func (HealthCondition) Equal added in v0.5.9

func (c HealthCondition) Equal(other HealthCondition) bool

Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.

func (HealthCondition) WithMessage added in v0.5.9

func (c HealthCondition) WithMessage(msg string) HealthCondition

WithMessage returns a condition by adding the provided message to existing condition.

type HealthConditionedStatus added in v0.5.9

type HealthConditionedStatus struct {
	// Status of the health in percentage
	Percentage uint32 `json:"percentage,omitempty"`

	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`

	// HealthConditions that determine the health status.
	// +optional
	HealthConditions []HealthCondition `json:"healthConditions,omitempty"`
}

func NewHealthConditionedStatus added in v0.5.9

func NewHealthConditionedStatus(p uint32, c ...HealthCondition) *HealthConditionedStatus

NewConditionedStatus returns a stat with the supplied conditions set.

func (*HealthConditionedStatus) DeepCopy added in v0.5.9

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

func (*HealthConditionedStatus) DeepCopyInto added in v0.5.9

func (in *HealthConditionedStatus) DeepCopyInto(out *HealthConditionedStatus)

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

func (*HealthConditionedStatus) Equal added in v0.5.9

Equal returns true if the status is identical to the supplied status, ignoring the LastTransitionTimes and order of statuses.

func (*HealthConditionedStatus) GetHealthCondition added in v0.5.9

func (s *HealthConditionedStatus) GetHealthCondition(resourceName, hck string) HealthCondition

GetCondition returns the condition for the given ConditionKind if exists, otherwise returns nil

func (*HealthConditionedStatus) SetHealthConditions added in v0.5.9

func (s *HealthConditionedStatus) SetHealthConditions(c ...HealthCondition)

SetConditions sets the supplied conditions, replacing any existing conditions of the same kind. This is a no-op if all supplied conditions are identical, ignoring the last transition time, to those already set.

type Lifecycle added in v0.5.9

type Lifecycle struct {
	// Active specifies if the managed resource is active or plannned
	// +kubebuilder:validation:Enum=`active`;`planned`
	// +kubebuilder:default=active
	DeploymentPolicy DeploymentPolicy `json:"deploymentPolicy,omitempty"`

	// DeletionPolicy specifies what will happen to the underlying external
	// when this managed resource is deleted - either "delete" or "orphan" the
	// external resource.
	// +kubebuilder:validation:Enum=`delete`;`orphan`
	// +kubebuilder:default=delete
	DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
}

func (*Lifecycle) DeepCopy added in v0.5.9

func (in *Lifecycle) DeepCopy() *Lifecycle

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

func (*Lifecycle) DeepCopyInto added in v0.5.9

func (in *Lifecycle) DeepCopyInto(out *Lifecycle)

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

type OdaInfo added in v0.5.9

type OdaInfo struct {
	//Oda []Tag `json:"oda,omitempty"`
	Oda map[string]string `json:"oda,omitempty"`
}

func (*OdaInfo) DeepCopy added in v0.5.9

func (in *OdaInfo) DeepCopy() *OdaInfo

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

func (*OdaInfo) DeepCopyInto added in v0.5.9

func (in *OdaInfo) DeepCopyInto(out *OdaInfo)

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

func (*OdaInfo) GetAvailabilityZone added in v0.5.9

func (x *OdaInfo) GetAvailabilityZone() string

func (*OdaInfo) GetDeployment added in v0.5.9

func (x *OdaInfo) GetDeployment() string

func (*OdaInfo) GetOrganization added in v0.5.9

func (x *OdaInfo) GetOrganization() string

func (*OdaInfo) SetAvailabilityZone added in v0.5.9

func (x *OdaInfo) SetAvailabilityZone(s string)

func (*OdaInfo) SetDeployment added in v0.5.9

func (x *OdaInfo) SetDeployment(s string)

func (*OdaInfo) SetOrganization added in v0.5.9

func (x *OdaInfo) SetOrganization(s string)

func (*OdaInfo) SetResourceName added in v0.5.21

func (x *OdaInfo) SetResourceName(s string)

type OdaKind added in v0.5.9

type OdaKind string
const (
	OdaKindOrganization    OdaKind = "organization"
	OdaKindDeployment      OdaKind = "deployment"
	OdaKindAvailabiityZone OdaKind = "availabilityZone"
	OdaKindUnknown         OdaKind = "unknown"
	OdaKindResourceName    OdaKind = "resourceName"
)

func (OdaKind) String added in v0.5.9

func (s OdaKind) String() string

type Reference

type Reference struct {
	// Name of the referenced object.
	Name string `json:"name"`
}

A Reference to a named object.

func (*Reference) DeepCopy

func (in *Reference) DeepCopy() *Reference

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

func (*Reference) DeepCopyInto

func (in *Reference) DeepCopyInto(out *Reference)

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

type ResourceName

type ResourceName struct {
	Name string `json:"name,omitempty"`
}

func (*ResourceName) DeepCopy

func (in *ResourceName) DeepCopy() *ResourceName

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

func (*ResourceName) DeepCopyInto

func (in *ResourceName) DeepCopyInto(out *ResourceName)

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

type ResourceSpec

type ResourceSpec struct {
	// Lifecycle determines the deletion and deployment lifecycle policies the resource
	// will follow
	Lifecycle Lifecycle `json:"lifecycle,omitempty"`

	// TargetReference specifies which target will be used to
	// perform crud operations for the managed resource
	TargetReference *Reference `json:"targetRef,omitempty"`
}

A ResourceSpec defines the desired state of a managed resource.

func (*ResourceSpec) DeepCopy

func (in *ResourceSpec) DeepCopy() *ResourceSpec

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

func (*ResourceSpec) DeepCopyInto

func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)

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

type ResourceStatus

type ResourceStatus struct {
	// the condition status
	ConditionedStatus `json:",inline"`
	// the health condition status
	Health HealthConditionedStatus `json:"health,omitempty"`
	// the oda info
	OdaInfo `json:",inline"`
	// rootPaths define the rootPaths of the cr, used to monitor the resource status
	RootPaths []string `json:"rootPaths,omitempty"`
}

ResourceStatus represents the observed state of a managed resource.

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

type Selector

type Selector struct {
	// MatchLabels ensures an object with matching labels is selected.
	MatchLabels map[string]string `json:"matchLabels,omitempty"`

	// MatchControllerRef ensures an object with the same controller reference
	// as the selecting object is selected.
	MatchControllerRef *bool `json:"matchControllerRef,omitempty"`
}

A Selector selects an object.

func (*Selector) DeepCopy

func (in *Selector) DeepCopy() *Selector

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

func (*Selector) DeepCopyInto

func (in *Selector) DeepCopyInto(out *Selector)

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

type TargetStatus added in v0.5.0

type TargetStatus struct {
	ConditionedStatus `json:",inline"`

	// Users of this target configuration.
	Users int64 `json:"users,omitempty"`
}

A TargetStatus defines the observed status of a target.

func (*TargetStatus) DeepCopy added in v0.5.0

func (in *TargetStatus) DeepCopy() *TargetStatus

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

func (*TargetStatus) DeepCopyInto added in v0.5.0

func (in *TargetStatus) DeepCopyInto(out *TargetStatus)

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

type TargetUsage added in v0.5.0

type TargetUsage struct {
	// TargetReference to the target being used.
	TargetReference Reference `json:"TargetRef"`

	// ResourceReference to the managed resource using the target config.
	ResourceReference TypedReference `json:"resourceRef"`
}

A TargetUsage is a record that a particular managed resource is using a particular target configuration.

func (*TargetUsage) DeepCopy added in v0.5.0

func (in *TargetUsage) DeepCopy() *TargetUsage

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

func (*TargetUsage) DeepCopyInto added in v0.5.0

func (in *TargetUsage) DeepCopyInto(out *TargetUsage)

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

type TransactionResourceStatus added in v0.2.25

type TransactionResourceStatus struct {
	// the condition status
	ConditionedStatus `json:",inline"`

	// conditionsStatus per device
	Device map[string]ConditionedStatus `json:"device,omitempty"`
}

func (*TransactionResourceStatus) DeepCopy added in v0.2.30

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

func (*TransactionResourceStatus) DeepCopyInto added in v0.2.30

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

type TypedReference

type TypedReference struct {
	// APIVersion of the referenced object.
	APIVersion string `json:"apiVersion"`

	// Kind of the referenced object.
	Kind string `json:"kind"`

	// Name of the referenced object.
	Name string `json:"name"`

	// UID of the referenced object.
	// +optional
	UID types.UID `json:"uid,omitempty"`
}

A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known.

func (*TypedReference) DeepCopy

func (in *TypedReference) DeepCopy() *TypedReference

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

func (*TypedReference) DeepCopyInto

func (in *TypedReference) DeepCopyInto(out *TypedReference)

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

func (*TypedReference) GetObjectKind

func (obj *TypedReference) GetObjectKind() schema.ObjectKind

GetObjectKind get the ObjectKind of a TypedReference.

func (*TypedReference) GroupVersionKind

func (obj *TypedReference) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind gets the GroupVersionKind of a TypedReference.

func (*TypedReference) SetGroupVersionKind

func (obj *TypedReference) SetGroupVersionKind(gvk schema.GroupVersionKind)

SetGroupVersionKind sets the Kind and APIVersion of a TypedReference.

Jump to

Keyboard shortcuts

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