Documentation ¶
Index ¶
- Variables
- func EnactmentKey(node, policy string) types.NamespacedName
- type Condition
- type ConditionList
- type ConditionReason
- type ConditionType
- type NodeNetworkConfigurationEnactmentCapturedState
- type NodeNetworkConfigurationEnactmentMetaInfo
- type NodeNetworkConfigurationEnactmentStatus
- type NodeNetworkConfigurationPolicySpec
- type NodeNetworkConfigurationPolicyStatus
- type NodeNetworkStateStatus
- type RawState
- type State
Constants ¶
This section is empty.
Variables ¶
var NodeNetworkConfigurationEnactmentConditionTypes = [...]ConditionType{ NodeNetworkConfigurationEnactmentConditionAvailable, NodeNetworkConfigurationEnactmentConditionFailing, NodeNetworkConfigurationEnactmentConditionProgressing, NodeNetworkConfigurationEnactmentConditionPending, NodeNetworkConfigurationEnactmentConditionAborted, }
var NodeNetworkConfigurationPolicyConditionTypes = [...]ConditionType{ NodeNetworkConfigurationPolicyConditionAvailable, NodeNetworkConfigurationPolicyConditionDegraded, NodeNetworkConfigurationPolicyConditionProgressing, }
Functions ¶
func EnactmentKey ¶
func EnactmentKey(node, policy string) types.NamespacedName
Types ¶
type Condition ¶
type Condition struct { Type ConditionType `json:"type"` Status corev1.ConditionStatus `json:"status"` Reason ConditionReason `json:"reason,omitempty"` Message string `json:"message,omitempty"` LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"` LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
func NewCondition ¶
func NewCondition(conditionType ConditionType, status corev1.ConditionStatus, reason ConditionReason, message string) Condition
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.
type ConditionList ¶
type ConditionList []Condition
func (ConditionList) DeepCopy ¶
func (in ConditionList) DeepCopy() ConditionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionList.
func (ConditionList) DeepCopyInto ¶
func (in ConditionList) DeepCopyInto(out *ConditionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ConditionList) Find ¶
func (conditions ConditionList) Find(conditionType ConditionType) *Condition
func (*ConditionList) Set ¶
func (conditions *ConditionList) Set(conditionType ConditionType, status corev1.ConditionStatus, reason ConditionReason, message string)
type ConditionReason ¶
type ConditionReason string
const ( NodeNetworkConfigurationEnactmentConditionFailedToConfigure ConditionReason = "FailedToConfigure" NodeNetworkConfigurationEnactmentConditionSuccessfullyConfigured ConditionReason = "SuccessfullyConfigured" NodeNetworkConfigurationEnactmentConditionConfigurationProgressing ConditionReason = "ConfigurationProgressing" NodeNetworkConfigurationEnactmentConditionConfigurationAborted ConditionReason = "ConfigurationAborted" )
const ( NodeNetworkConfigurationPolicyConditionFailedToConfigure ConditionReason = "FailedToConfigure" NodeNetworkConfigurationPolicyConditionSuccessfullyConfigured ConditionReason = "SuccessfullyConfigured" NodeNetworkConfigurationPolicyConditionConfigurationProgressing ConditionReason = "ConfigurationProgressing" NodeNetworkConfigurationPolicyConditionConfigurationNoMatchingNode ConditionReason = "NoMatchingNode" )
const ( NodeNetworkStateConditionFailedToConfigure ConditionReason = "FailedToConfigure" NodeNetworkStateConditionSuccessfullyConfigured ConditionReason = "SuccessfullyConfigured" )
type ConditionType ¶
type ConditionType string
const ( EnactmentPolicyLabel = "nmstate.io/policy" EnactmentNodeLabel = "nmstate.io/node" NodeNetworkConfigurationEnactmentConditionAvailable ConditionType = "Available" NodeNetworkConfigurationEnactmentConditionFailing ConditionType = "Failing" NodeNetworkConfigurationEnactmentConditionPending ConditionType = "Pending" NodeNetworkConfigurationEnactmentConditionProgressing ConditionType = "Progressing" NodeNetworkConfigurationEnactmentConditionAborted ConditionType = "Aborted" )
const ( NodeNetworkConfigurationPolicyConditionAvailable ConditionType = "Available" NodeNetworkConfigurationPolicyConditionDegraded ConditionType = "Degraded" NodeNetworkConfigurationPolicyConditionProgressing ConditionType = "Progressing" )
const ( NodeNetworkStateConditionAvailable ConditionType = "Available" NodeNetworkStateConditionFailing ConditionType = "Failing" )
type NodeNetworkConfigurationEnactmentCapturedState ¶
type NodeNetworkConfigurationEnactmentCapturedState struct { // +kubebuilder:validation:XPreserveUnknownFields State State `json:"state,omitempty"` MetaInfo NodeNetworkConfigurationEnactmentMetaInfo `json:"metaInfo,omitempty"` }
type NodeNetworkConfigurationEnactmentStatus ¶
type NodeNetworkConfigurationEnactmentStatus struct { // +kubebuilder:validation:XPreserveUnknownFields // The desired state rendered for the enactment's node using // the policy desiredState as template DesiredState State `json:"desiredState,omitempty"` DesiredStateMetaInfo NodeNetworkConfigurationEnactmentMetaInfo `json:"desiredStateMetaInfo,omitempty"` // A cache containing the resolved captures after processing the capture at NNCP CapturedStates map[string]NodeNetworkConfigurationEnactmentCapturedState `json:"capturedStates,omitempty"` // The generation from policy needed to check if an enactment // condition status belongs to the same policy version PolicyGeneration int64 `json:"policyGeneration,omitempty"` Conditions ConditionList `json:"conditions,omitempty"` Features []string `json:"features,omitempty"` }
NodeNetworkConfigurationEnactmentStatus defines the observed state of NodeNetworkConfigurationEnactment
func (*NodeNetworkConfigurationEnactmentStatus) DeepCopy ¶
func (in *NodeNetworkConfigurationEnactmentStatus) DeepCopy() *NodeNetworkConfigurationEnactmentStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNetworkConfigurationEnactmentStatus.
func (*NodeNetworkConfigurationEnactmentStatus) DeepCopyInto ¶
func (in *NodeNetworkConfigurationEnactmentStatus) DeepCopyInto(out *NodeNetworkConfigurationEnactmentStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeNetworkConfigurationPolicySpec ¶
type NodeNetworkConfigurationPolicySpec struct { // NodeSelector is a selector which must be true for the policy to be applied to the node. // Selector which must match a node's labels for the policy to be scheduled on that node. // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` // Capture contains expressions with an associated name than can be referenced // at the DesiredState. // +optional Capture map[string]string `json:"capture,omitempty"` // +kubebuilder:validation:XPreserveUnknownFields // The desired configuration of the policy DesiredState State `json:"desiredState,omitempty"` // of machines that can be updating at a time. Default is "50%". // +optional MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` }
NodeNetworkConfigurationPolicySpec defines the desired state of NodeNetworkConfigurationPolicy
func (*NodeNetworkConfigurationPolicySpec) DeepCopy ¶
func (in *NodeNetworkConfigurationPolicySpec) DeepCopy() *NodeNetworkConfigurationPolicySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNetworkConfigurationPolicySpec.
func (*NodeNetworkConfigurationPolicySpec) DeepCopyInto ¶
func (in *NodeNetworkConfigurationPolicySpec) DeepCopyInto(out *NodeNetworkConfigurationPolicySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeNetworkConfigurationPolicyStatus ¶
type NodeNetworkConfigurationPolicyStatus struct { Conditions ConditionList `json:"conditions,omitempty" optional:"true"` // processing a NodeNetworkConfigurationPolicy // +optional UnavailableNodeCount int `json:"unavailableNodeCount,omitempty" optional:"true"` // +optional LastUnavailableNodeCountUpdate *metav1.Time `json:"lastUnavailableNodeCountUpdate,omitempty" optional:"true"` }
NodeNetworkConfigurationPolicyStatus defines the observed state of NodeNetworkConfigurationPolicy
func (*NodeNetworkConfigurationPolicyStatus) DeepCopy ¶
func (in *NodeNetworkConfigurationPolicyStatus) DeepCopy() *NodeNetworkConfigurationPolicyStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNetworkConfigurationPolicyStatus.
func (*NodeNetworkConfigurationPolicyStatus) DeepCopyInto ¶
func (in *NodeNetworkConfigurationPolicyStatus) DeepCopyInto(out *NodeNetworkConfigurationPolicyStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodeNetworkStateStatus ¶
type NodeNetworkStateStatus struct { // +kubebuilder:validation:XPreserveUnknownFields CurrentState State `json:"currentState,omitempty"` LastSuccessfulUpdateTime metav1.Time `json:"lastSuccessfulUpdateTime,omitempty"` HostNetworkManagerVersion string `json:"hostNetworkManagerVersion,omitempty"` HandlerNetworkManagerVersion string `json:"handlerNetworkManagerVersion,omitempty"` HandlerNmstateVersion string `json:"handlerNmstateVersion,omitempty"` Conditions ConditionList `json:"conditions,omitempty" optional:"true"` }
NodeNetworkStateStatus is the status of the NodeNetworkState of a specific node
func (*NodeNetworkStateStatus) DeepCopy ¶
func (in *NodeNetworkStateStatus) DeepCopy() *NodeNetworkStateStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNetworkStateStatus.
func (*NodeNetworkStateStatus) DeepCopyInto ¶
func (in *NodeNetworkStateStatus) DeepCopyInto(out *NodeNetworkStateStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RawState ¶
type RawState []byte
func (RawState) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawState.
func (RawState) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type State ¶
type State struct {
Raw RawState `json:"-"`
}
State contains the namestatectl yaml [1] as string instead of golang struct so we don't need to be in sync with the schema.
[1] https://github.com/nmstate/nmstate/blob/base/libnmstate/schemas/operational-state.yaml +kubebuilder:validation:Type=object
func (*State) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new State.
func (*State) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (State) MarshalJSON ¶
We are using behind the scenes the golang encode/json so we need to return json here for golang to work well, the upper yaml parser will convert it to yaml making nmstate yaml transparent to kubernetes-nmstate
func (State) OpenAPISchemaType ¶
[1] https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators
func (*State) UnmarshalJSON ¶
Bypass State parsing and directly store it as yaml string to later on pass it to namestatectl using it as transparet data at kubernetes-nmstate