Documentation ¶
Overview ¶
Package v1 contains core API types used by most ndd resources. +kubebuilder:object:generate=true
Index ¶
- Constants
- type Condition
- func Available() Condition
- func Creating() Condition
- func Deleting() Condition
- func Failed(msg string) Condition
- func Pending() Condition
- func ReconcileError(err error) Condition
- func ReconcileSuccess() Condition
- func RootPathValidationFailure() Condition
- func RootPathValidationSuccess() Condition
- func RootPathValidationUnknown() Condition
- func TargetFound() Condition
- func TargetNotFound() Condition
- func Unavailable() Condition
- func Unknown() Condition
- func Updating() Condition
- type ConditionKind
- type ConditionReason
- type ConditionedStatus
- func (in *ConditionedStatus) DeepCopy() *ConditionedStatus
- func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus)
- func (s *ConditionedStatus) Equal(other *ConditionedStatus) bool
- func (s *ConditionedStatus) GetCondition(ck ConditionKind) Condition
- func (s *ConditionedStatus) SetConditions(c ...Condition)
- type DeletionPolicy
- type DeploymentPolicy
- type Reference
- type ResourceName
- type ResourceSpec
- type ResourceStatus
- type Selector
- type Target
- type TargetStatus
- type TargetUsage
- type TransactionResourceStatus
- type TypedReference
- func (in *TypedReference) DeepCopy() *TypedReference
- func (in *TypedReference) DeepCopyInto(out *TypedReference)
- func (obj *TypedReference) GetObjectKind() schema.ObjectKind
- func (obj *TypedReference) GroupVersionKind() schema.GroupVersionKind
- func (obj *TypedReference) SetGroupVersionKind(gvk schema.GroupVersionKind)
Constants ¶
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
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 ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Condition) Equal ¶
Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.
func (Condition) WithMessage ¶
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 //ConditionKindLeafRef ConditionKind = "LeafrefValidationSuccess" // handled per resource //ConditionKindInternalLeafRef ConditionKind = "InternalLeafrefValidationSuccess" // handled per target per resource //ConditionKindExternalLeafRef ConditionKind = "ExternalLeafrefValidationSuccess" // handled per resource ConditionKindRootPath ConditionKind = "RootPathValidationSuccess" // 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" 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. +kubebuilder:validation:Enum=Orphan;Delete
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. +kubebuilder:validation:Enum=Active;Planned
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 Reference ¶
type Reference struct { // Name of the referenced object. Name string `json:"name"` }
A Reference to a named object.
func (*Reference) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reference.
func (*Reference) DeepCopyInto ¶
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 { // Active specifies if the managed resource is active or not // +kubebuilder:default=Active DeploymentPolicy DeploymentPolicy `json:"deploymentPolicy,omitempty"` // TargetReference specifies which target will be used to // create, observe, update, and delete this managed resource TargetReference *Reference `json:"targetRef"` // DeletionPolicy specifies what will happen to the underlying external // when this managed resource is deleted - either "Delete" or "Orphan" the // external resource. // +optional // +kubebuilder:default=Delete DeletionPolicy DeletionPolicy `json:"deletionPolicy,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"` // rootPaths define the rootPaths of the cr, used to monitor the resource status RootPaths []string `json:"rootPaths,omitempty"` // HierPaths tracks the hierarchical paths of the CR based on adjacent resources HierPaths map[string][]string `json:"hierPaths,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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selector.
func (*Selector) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Target ¶
type Target struct { // Name of the Target Name string `json:"name,omitempty"` // Configuration that is used by the gnmi client Config *types.TargetConfig `json:"config,omitempty"` // Target gnmi client Target *target.Target `json:"target,omitempty"` }
+k8s:deepcopy-gen=false
func (*Target) IsTargetDeleted ¶
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
func (in *TransactionResourceStatus) DeepCopy() *TransactionResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TransactionResourceStatus.
func (*TransactionResourceStatus) DeepCopyInto ¶ added in v0.2.30
func (in *TransactionResourceStatus) DeepCopyInto(out *TransactionResourceStatus)
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.