v1

package
v0.4.117 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Overview

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

Index

Constants

View Source
const LabelKeyNetworkNodeName = "ndd.yndd.io/networknode"

LabelKeyNetworkNodeName is added to NetworkNodeUsages to relate them to their NetworkNode.

Variables

View Source
var RegisterPath = &gnmi.Path{
	Elem: []*gnmi.PathElem{
		{Name: RegisterPathElemName, Key: map[string]string{RegisterPathElemKey: ""}},
	},
}
View Source
var RegisterPathElemKey = "name"
View Source
var RegisterPathElemName = "ndd-registration"

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 added in v0.3.64

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 ExternalLeafRefValidationFailure

func ExternalLeafRefValidationFailure() Condition

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

func ExternalLeafRefValidationSuccess

func ExternalLeafRefValidationSuccess() Condition

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

func ExternalLeafRefValidationUnknown added in v0.4.15

func ExternalLeafRefValidationUnknown() Condition

ExternalLeafRefValidationUnknown returns a condition that indicates the external leafref validation is unknown

func LocalLeafRefValidationFailure added in v0.4.15

func LocalLeafRefValidationFailure() Condition

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

func LocalLeafRefValidationSuccess added in v0.4.15

func LocalLeafRefValidationSuccess() Condition

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

func LocalLeafRefValidationUnknown added in v0.4.15

func LocalLeafRefValidationUnknown() Condition

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

func ParentValidationFailure

func ParentValidationFailure() Condition

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

func ParentValidationSuccess

func ParentValidationSuccess() Condition

ParentValidationFailure returns a condition that indicates the resource parent is found

func ParentValidationUnknown added in v0.4.15

func ParentValidationUnknown() Condition

ParentValidationUnknown returns a condition that indicates the parent validation is unknown

func ReconcileError added in v0.3.64

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 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 added in v0.3.64

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 added in v0.3.55

func Unknown() Condition

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

func Updating added in v0.3.64

func Updating() Condition

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

func (*Condition) DeepCopy added in v0.3.7

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto added in v0.3.7

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
	ConditionKindInternalLeafRef ConditionKind = "InternalLeafrefValidationSuccess"
	// handled per target per resource
	ConditionKindExternalLeafRef ConditionKind = "ExternalLeafrefValidationSuccess"
	// handled per resource
	ConditionKindParent ConditionKind = "ParentValidationSuccess"
	// 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"
)

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 added in v0.3.7

func (in *ConditionedStatus) DeepCopy() *ConditionedStatus

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

func (*ConditionedStatus) DeepCopyInto added in v0.3.7

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 added in v0.3.50

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 DeviceType added in v0.3.38

type DeviceType string
const (
	DeviceTypeUnknown DeviceType = ""
)

func DeviceTypePtr added in v0.3.38

func DeviceTypePtr(c DeviceType) *DeviceType

type NetworkNodeStatus added in v0.3.68

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

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

A NetworkNodeStatus defines the observed status of a NetworkNode.

func (*NetworkNodeStatus) DeepCopy added in v0.3.68

func (in *NetworkNodeStatus) DeepCopy() *NetworkNodeStatus

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

func (*NetworkNodeStatus) DeepCopyInto added in v0.3.68

func (in *NetworkNodeStatus) DeepCopyInto(out *NetworkNodeStatus)

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

type NetworkNodeUsage added in v0.3.68

type NetworkNodeUsage struct {
	// NetworkNodeReference to the network node config being used.
	NetworkNodeReference Reference `json:"NetworkNodeRef"`

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

A NetworkNodeUsage is a record that a particular managed resource is using a particular network node configuration.

func (*NetworkNodeUsage) DeepCopy added in v0.3.68

func (in *NetworkNodeUsage) DeepCopy() *NetworkNodeUsage

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

func (*NetworkNodeUsage) DeepCopyInto added in v0.3.68

func (in *NetworkNodeUsage) DeepCopyInto(out *NetworkNodeUsage)

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

type Reference added in v0.3.10

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

A Reference to a named object.

func (*Reference) DeepCopy added in v0.3.10

func (in *Reference) DeepCopy() *Reference

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

func (*Reference) DeepCopyInto added in v0.3.10

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

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

type Register added in v0.4.105

type Register struct {
	// MatchString defines the string to match the devices for discovery
	// +optional
	MatchString string `json:"matchString,omitempty"`

	// Registrations defines the Registrations the device driver subscribes to for config change notifications
	// +optional
	Subscriptions []string `json:"subscriptions,omitempty"`

	// ExceptionPaths defines the exception paths that should be ignored during change notifications
	// if the xpath contains the exception path it is considered a match
	// +optional
	ExceptionPaths []string `json:"exceptionPaths,omitempty"`

	// ExplicitExceptionPaths defines the exception paths that should be ignored during change notifications
	// the match should be exact to condider this xpath
	// +optional
	ExplicitExceptionPaths []string `json:"explicitExceptionPaths,omitempty"`
}

RegistrationParameters defines the Registrations the device driver subscribes to for config change notifications

func (*Register) DeepCopy added in v0.4.105

func (in *Register) DeepCopy() *Register

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

func (*Register) DeepCopyInto added in v0.4.105

func (in *Register) DeepCopyInto(out *Register)

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

func (*Register) GetSubscriptions added in v0.4.105

func (r *Register) GetSubscriptions() []string

func (*Register) SetSubscriptions added in v0.4.105

func (r *Register) SetSubscriptions(s []string)

type ResourceName added in v0.4.104

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

func (*ResourceName) DeepCopy added in v0.4.104

func (in *ResourceName) DeepCopy() *ResourceName

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

func (*ResourceName) DeepCopyInto added in v0.4.104

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 added in v0.3.50

type ResourceSpec struct {
	// Active specifies if the managed resource is active or not
	// +kubebuilder:default=true
	Active bool `json:"active,omitempty"`

	// NetworkNodeReference specifies which network node will be used to
	// create, observe, update, and delete this managed resource
	// +kubebuilder:default={"name": "default"}
	NetworkNodeReference *Reference `json:"networkNodeRef,omitempty"`

	// 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 added in v0.3.53

func (in *ResourceSpec) DeepCopy() *ResourceSpec

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

func (*ResourceSpec) DeepCopyInto added in v0.3.53

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 added in v0.3.52

type ResourceStatus struct {
	// the condition status
	ConditionedStatus `json:",inline"`
	// Target used by the resource
	Target []string `json:"target,omitempty"`
	// ExternalLeafRefs tracks the external resources this resource is dependent upon
	ExternalLeafRefs []string `json:"externalLeafRefs,omitempty"`
	// ResourceIndexes tracks the indexes that or used by the resource
	ResourceIndexes map[string]string `json:"resourceIndexes,omitempty"`
}

ResourceStatus represents the observed state of a managed resource.

func (*ResourceStatus) DeepCopy added in v0.3.53

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto added in v0.3.53

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 added in v0.3.50

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 added in v0.3.53

func (in *Selector) DeepCopy() *Selector

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

func (*Selector) DeepCopyInto added in v0.3.53

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

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

type Target added in v0.3.41

type Target struct {
	Name   string
	Cfg    ndd.Config          // this is the config client code
	Config *types.TargetConfig // this is gnmi based
	Target *target.Target      // this is gnmi based
}

func (*Target) DeepCopy added in v0.3.53

func (in *Target) DeepCopy() *Target

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

func (*Target) DeepCopyInto added in v0.3.53

func (in *Target) DeepCopyInto(out *Target)

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

func (*Target) IsTargetDeleted added in v0.3.76

func (t *Target) IsTargetDeleted(ns []string) bool

type TypedReference added in v0.3.24

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 added in v0.3.24

func (in *TypedReference) DeepCopy() *TypedReference

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

func (*TypedReference) DeepCopyInto added in v0.3.24

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 added in v0.3.50

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

GetObjectKind get the ObjectKind of a TypedReference.

func (*TypedReference) GroupVersionKind added in v0.3.50

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

GroupVersionKind gets the GroupVersionKind of a TypedReference.

func (*TypedReference) SetGroupVersionKind added in v0.3.50

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