Documentation
¶
Index ¶
Constants ¶
View Source
const ( // rdmaNetnsModeShared and rdmaNetnsModeExclusive define the RDMA subsystem // network namespace mode. An RDMA device can only be assigned to a network // namespace when the RDMA subsystem is set to an "exclusive" network // namespace mode. When the subsystem is set to "shared" mode, an attempt to // assign an RDMA device to a network namespace will result in failure. // Additionally, "If there are active network namespaces and if one or more // RDMA devices exist, changing mode from shared to exclusive returns error // code EBUSY." // // Ref. https://man7.org/linux/man-pages/man8/rdma-system.8.html RdmaNetnsModeExclusive = "exclusive" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceConfig ¶
type InterfaceConfig struct {
Name string `json:"name,omitempty"` // Logical name of the interface (e.g., "eth0", "enp0s3")
Addresses []string `json:"addresses,omitempty"` // IP addresses and their CIDR masks
MTU int32 `json:"mtu,omitempty"` // Maximum Transmission Unit, optional
HardwareAddr string `json:"hardwareAddr,omitempty"` // Read-only: Current hardware address (might be useful for GET)
}
InterfaceConfig represents the configuration for a single network interface.
type NetworkConfig ¶
type NetworkConfig struct {
Interface InterfaceConfig `json:"interface"` // Changed to a slice to support multiple interfaces
Routes []RouteConfig `json:"routes"`
}
NetworkConfig represents the desired state of all network interfaces and their associated routes.
func ValidateConfig ¶
func ValidateConfig(raw *runtime.RawExtension) (*NetworkConfig, error)
ValidateConfig validates the data in a runtime.RawExtension against the OpenAPI schema.
type RouteConfig ¶
type RouteConfig struct {
Destination string `json:"destination,omitempty"` // e.g., "0.0.0.0/0" for default, "10.0.0.0/8"
Gateway string `json:"gateway,omitempty"` // The "gateway" address, e.g., "192.168.1.1"
Source string `json:"source,omitempty"` // Optional source address for policy routing
Scope uint8 `json:"scope,omitempty"` // Optional scope of the route, only Link (253) or Universe (0) allowed
}
RouteConfig represents a network route configuration.
Click to show internal directories.
Click to hide internal directories.