Documentation
¶
Index ¶
- func GetChangedVirtualInterfaces(source, target State) ([]net.Interface, error)
- func GetInterfaceTypeStatePath(t net.InterfaceType) string
- func IsUnknownError(err Error) bool
- func SanitizeDeviceName(name string) string
- type ConfigurationInvalidatedError
- type Device
- func (d *Device) Clear()
- func (in *Device) DeepCopy() *Device
- func (in *Device) DeepCopyInto(out *Device)
- func (d Device) EqualsIgnoringSorting(target Device) bool
- func (d Device) MarshalJSON() (output []byte, err error)
- func (Device) OpenAPISchemaType() []string
- func (d Device) String() string
- func (d *Device) UnmarshalJSON(b []byte) error
- type Error
- type InvalidConfigurationError
- type MultipleErrors
- type NetworkState
- type OvsTimeoutError
- type RawDevice
- type State
- func (s State) Clone() State
- func (s State) ContainsVirtualInterfaces() bool
- func (in *State) DeepCopy() *State
- func (in *State) DeepCopyInto(out *State)
- func (s State) DeviceIterator() StateDeviceIterator
- func (s State) Equals(target State) bool
- func (s1 *State) FindOverrides(s2 *State) (string, error)
- func (s State) IsEmpty() bool
- func (s1 *State) Merge(s2 *State) error
- func (s State) String() string
- func (s State) YAML() string
- type StateDeviceIterator
- type StateDeviceIteratorItem
- type TransactionError
- type UnknownError
- type UnkownObjectError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInterfaceTypeStatePath ¶
func GetInterfaceTypeStatePath(t net.InterfaceType) string
func IsUnknownError ¶
func SanitizeDeviceName ¶
Types ¶
type ConfigurationInvalidatedError ¶
type ConfigurationInvalidatedError struct{}
func (ConfigurationInvalidatedError) Error ¶
func (e ConfigurationInvalidatedError) Error() string
func (ConfigurationInvalidatedError) ShouldRetry ¶
func (e ConfigurationInvalidatedError) ShouldRetry() bool
type Device ¶
type Device struct {
Raw RawDevice `json:"-"`
}
+kubebuilder:object:generate=true +kubebuilder:validation:XPreserveUnknownFields
func (*Device) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
func (*Device) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (Device) EqualsIgnoringSorting ¶
EqualsIgnoringSorting compares 2 devices, not only by Raw string but also after unmarshal, ignoring string slice order. This is a hack to not detect differences in virtual devices where the interfaces may be in different order (netplan not always outputs the same order)
func (Device) 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 (Device) OpenAPISchemaType ¶
[1] https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators
func (*Device) 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
type Error ¶
func ParseError ¶
type InvalidConfigurationError ¶
type InvalidConfigurationError struct {
Err error
}
func (InvalidConfigurationError) Error ¶
func (e InvalidConfigurationError) Error() string
func (InvalidConfigurationError) ShouldRetry ¶
func (e InvalidConfigurationError) ShouldRetry() bool
type MultipleErrors ¶
type MultipleErrors struct {
Errors []Error
}
func (MultipleErrors) Error ¶
func (e MultipleErrors) Error() string
func (MultipleErrors) ShouldRetry ¶
func (e MultipleErrors) ShouldRetry() bool
type NetworkState ¶
type NetworkState struct { Version int `json:"version,omitempty"` Ethernets map[string]Device `json:"ethernets,omitempty"` Modems map[string]Device `json:"modems,omitempty"` Wifis map[string]Device `json:"wifis,omitempty"` Bridges map[string]Device `json:"bridges,omitempty"` Bonds map[string]Device `json:"bonds,omitempty"` Tunnels map[string]Device `json:"tunnels,omitempty"` VLans map[string]Device `json:"vlans,omitempty"` VRFs map[string]Device `json:"vrfs,omitempty"` }
+kubebuilder:object:generate=true
func (*NetworkState) DeepCopy ¶
func (in *NetworkState) DeepCopy() *NetworkState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkState.
func (*NetworkState) DeepCopyInto ¶
func (in *NetworkState) DeepCopyInto(out *NetworkState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (NetworkState) Equals ¶
func (s NetworkState) Equals(target NetworkState) bool
type OvsTimeoutError ¶
type OvsTimeoutError struct {
Err error
}
func (OvsTimeoutError) Error ¶
func (e OvsTimeoutError) Error() string
func (OvsTimeoutError) ShouldRetry ¶
func (e OvsTimeoutError) ShouldRetry() bool
type State ¶
type State struct {
Network NetworkState `json:"network"`
}
+kubebuilder:object:generate=true
func NewEmptyState ¶
func NewEmptyState() State
func (State) ContainsVirtualInterfaces ¶
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) DeviceIterator ¶
func (s State) DeviceIterator() StateDeviceIterator
type StateDeviceIterator ¶
type StateDeviceIterator struct {
// contains filtered or unexported fields
}
func (*StateDeviceIterator) Apply ¶
func (di *StateDeviceIterator) Apply(i StateDeviceIteratorItem)
func (*StateDeviceIterator) HasNext ¶
func (di *StateDeviceIterator) HasNext() bool
func (*StateDeviceIterator) Next ¶
func (di *StateDeviceIterator) Next() StateDeviceIteratorItem
type StateDeviceIteratorItem ¶
type StateDeviceIteratorItem struct { Name string Device Device Type net.InterfaceType }
type TransactionError ¶
func (TransactionError) Error ¶
func (e TransactionError) Error() string
func (TransactionError) ShouldRetry ¶
func (e TransactionError) ShouldRetry() bool
type UnknownError ¶
type UnknownError struct {
Err error
}
func (UnknownError) Error ¶
func (e UnknownError) Error() string
func (UnknownError) ShouldRetry ¶
func (e UnknownError) ShouldRetry() bool
type UnkownObjectError ¶
type UnkownObjectError struct {
Path string
}
func (UnkownObjectError) Error ¶
func (e UnkownObjectError) Error() string
func (UnkownObjectError) ShouldRetry ¶
func (e UnkownObjectError) ShouldRetry() bool