netplan

package
v0.4.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChangedVirtualInterfaces

func GetChangedVirtualInterfaces(source, target State) ([]net.Interface, error)

func GetInterfaceTypeStatePath

func GetInterfaceTypeStatePath(t net.InterfaceType) string

func IsUnknownError

func IsUnknownError(err Error) bool

func SanitizeDeviceName

func SanitizeDeviceName(name string) string

Types

type ConfigurationInvalidatedError

type ConfigurationInvalidatedError struct{}

func (ConfigurationInvalidatedError) Error

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) Clear

func (d *Device) Clear()

func (*Device) DeepCopy

func (in *Device) DeepCopy() *Device

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

func (*Device) DeepCopyInto

func (in *Device) DeepCopyInto(out *Device)

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

func (Device) EqualsIgnoringSorting

func (d Device) EqualsIgnoringSorting(target Device) bool

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

func (d Device) MarshalJSON() (output []byte, err error)

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) String

func (d Device) String() string

Simple stringer for State

func (*Device) UnmarshalJSON

func (d *Device) UnmarshalJSON(b []byte) error

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

type Error interface {
	ShouldRetry() bool
	Error() string
}

func ParseError

func ParseError(err error) Error

type InvalidConfigurationError

type InvalidConfigurationError struct {
	Err error
}

func (InvalidConfigurationError) Error

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 RawDevice

type RawDevice []byte

type State

type State struct {
	Network NetworkState `json:"network"`
}

+kubebuilder:object:generate=true

func NewEmptyState

func NewEmptyState() State

func NewState

func NewState(raw string) (State, error)

func (State) Clone

func (s State) Clone() State

func (State) ContainsVirtualInterfaces

func (s State) ContainsVirtualInterfaces() bool

func (*State) DeepCopy

func (in *State) DeepCopy() *State

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

func (*State) DeepCopyInto

func (in *State) DeepCopyInto(out *State)

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

func (State) Equals

func (s State) Equals(target State) bool

func (*State) FindOverrides

func (s1 *State) FindOverrides(s2 *State) (string, error)

func (State) IsEmpty

func (s State) IsEmpty() bool

func (*State) Merge

func (s1 *State) Merge(s2 *State) error

func (State) String

func (s State) String() string

Simple stringer for State

func (State) YAML

func (s State) YAML() string

type StateDeviceIterator

type StateDeviceIterator struct {
	// contains filtered or unexported fields
}

func (*StateDeviceIterator) Apply

func (*StateDeviceIterator) HasNext

func (di *StateDeviceIterator) HasNext() bool

func (*StateDeviceIterator) Next

type StateDeviceIteratorItem

type StateDeviceIteratorItem struct {
	Name   string
	Device Device
	Type   net.InterfaceType
}

type TransactionError

type TransactionError struct {
	CommitError   Error
	RollbackError Error
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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