From f4ad3077b0c56b200a37e97abd1a51c63a04c648 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 30 Oct 2025 19:54:40 +0400 Subject: [PATCH] feat: implement bond multi-doc configuration Also expand internal bond configuration to cover missing fields. They are not going to be exposed in legacy configuration. Fixes #10960 Signed-off-by: Andrey Smirnov --- api/resource/definitions/enums/enums.proto | 9 + .../definitions/network/network.proto | 4 + .../pkg/adapters/network/bond_master_spec.go | 87 ++- .../pkg/controllers/network/cmdline.go | 2 +- .../pkg/controllers/network/cmdline_test.go | 6 + .../pkg/controllers/network/link_config.go | 22 +- .../controllers/network/link_config_test.go | 26 +- .../pkg/controllers/network/link_spec.go | 7 +- .../pkg/controllers/network/network.go | 43 +- .../testdata/expected-2bonds.yaml | 2 + .../equinixmetal/testdata/expected.yaml | 1 + .../nocloud/testdata/expected-v1-pnap.yaml | 1 + .../testdata/expected-v2-serverscom.yaml | 2 + .../nocloud/testdata/expected-v2.yaml | 1 + .../platform/openstack/testdata/expected.yaml | 1 + internal/integration/api/network-config.go | 97 +++ .../resource/definitions/enums/enums.pb.go | 401 +++++++----- .../definitions/network/network.pb.go | 322 +++++---- .../definitions/network/network_vtproto.pb.go | 218 +++++++ pkg/machinery/config/config/network.go | 38 ++ .../config/schemas/config.schema.json | 340 +++++++++- pkg/machinery/config/types/network/bond.go | 613 ++++++++++++++++++ .../config/types/network/bond_test.go | 175 +++++ .../types/network/deep_copy.generated.go | 142 +++- pkg/machinery/config/types/network/link.go | 1 + pkg/machinery/config/types/network/network.go | 4 +- .../config/types/network/network_doc.go | 314 ++++++++- .../types/network/testdata/bondconfig.yaml | 18 + pkg/machinery/config/types/network/vlan.go | 1 + pkg/machinery/nethelpers/adlacpactive.go | 16 + .../nethelpers/arpalltargets_enumer.go | 104 ++- pkg/machinery/nethelpers/arpvalidate.go | 17 +- pkg/machinery/nethelpers/nethelpers.go | 2 +- .../resources/network/address_spec.go | 2 +- .../resources/network/deep_copy.generated.go | 22 +- pkg/machinery/resources/network/link.go | 254 +++++++- pkg/machinery/resources/network/link_spec.go | 5 +- .../resources/network/link_spec_test.go | 4 +- .../resources/network/link_status_test.go | 4 +- website/content/v1.12/reference/api.md | 20 + .../configuration/network/bondconfig.md | 213 ++++++ .../configuration/network/vlanconfig.md | 2 +- .../content/v1.12/schemas/config.schema.json | 340 +++++++++- 43 files changed, 3530 insertions(+), 373 deletions(-) create mode 100644 pkg/machinery/config/types/network/bond.go create mode 100644 pkg/machinery/config/types/network/bond_test.go create mode 100644 pkg/machinery/config/types/network/testdata/bondconfig.yaml create mode 100644 pkg/machinery/nethelpers/adlacpactive.go create mode 100644 website/content/v1.12/reference/configuration/network/bondconfig.md diff --git a/api/resource/definitions/enums/enums.proto b/api/resource/definitions/enums/enums.proto index 64e78160b..4984c8905 100755 --- a/api/resource/definitions/enums/enums.proto +++ b/api/resource/definitions/enums/enums.proto @@ -70,6 +70,12 @@ enum NethelpersAddressSortAlgorithm { ADDRESS_SORT_ALGORITHM_V2 = 1; } +// NethelpersADLACPActive is ADLACPActive. +enum NethelpersADLACPActive { + ADLACP_ACTIVE_OFF = 0; + ADLACP_ACTIVE_ON = 1; +} + // NethelpersADSelect is ADSelect. enum NethelpersADSelect { AD_SELECT_STABLE = 0; @@ -89,6 +95,9 @@ enum NethelpersARPValidate { ARP_VALIDATE_ACTIVE = 1; ARP_VALIDATE_BACKUP = 2; ARP_VALIDATE_ALL = 3; + ARP_VALIDATE_FILTER = 4; + ARP_VALIDATE_FILTER_ACTIVE = 5; + ARP_VALIDATE_FILTER_BACKUP = 6; } // NethelpersAutoHostnameKind is a kind of automatically generated hostname. diff --git a/api/resource/definitions/network/network.proto b/api/resource/definitions/network/network.proto index b231dd1d4..8a3712a2b 100755 --- a/api/resource/definitions/network/network.proto +++ b/api/resource/definitions/network/network.proto @@ -63,6 +63,10 @@ message BondMasterSpec { uint32 ad_actor_sys_prio = 22; uint32 ad_user_port_key = 23; uint32 peer_notify_delay = 24; + repeated common.NetIP arpip_targets = 25; + repeated common.NetIP nsip6_targets = 26; + talos.resource.definitions.enums.NethelpersADLACPActive adlacp_active = 27; + uint32 missed_max = 28; } // BondSlave contains a bond's master name and slave index. diff --git a/internal/app/machined/pkg/adapters/network/bond_master_spec.go b/internal/app/machined/pkg/adapters/network/bond_master_spec.go index 5cd479803..f56d9f899 100644 --- a/internal/app/machined/pkg/adapters/network/bond_master_spec.go +++ b/internal/app/machined/pkg/adapters/network/bond_master_spec.go @@ -5,7 +5,11 @@ package network import ( + "fmt" + "net/netip" + "github.com/mdlayher/netlink" + "github.com/siderolabs/go-pointer" "golang.org/x/sys/unix" "github.com/siderolabs/talos/pkg/machinery/nethelpers" @@ -26,6 +30,8 @@ type bondMaster struct { } // FillDefaults fills zero values with proper default values. +// +//nolint:gocyclo func (a bondMaster) FillDefaults() { bond := a.BondMasterSpec @@ -49,14 +55,22 @@ func (a bondMaster) FillDefaults() { bond.TLBDynamicLB = 1 } - if bond.Mode == nethelpers.BondMode8023AD { + if bond.Mode == nethelpers.BondMode8023AD && bond.ADActorSysPrio == 0 { bond.ADActorSysPrio = 65535 } + + if bond.MissedMax == 0 { + bond.MissedMax = 2 + } + + if bond.Mode != nethelpers.BondMode8023AD { + bond.ADLACPActive = nethelpers.ADLACPActiveOn + } } // Encode the BondMasterSpec into netlink attributes. // -//nolint:gocyclo +//nolint:gocyclo,cyclop func (a bondMaster) Encode() ([]byte, error) { bond := a.BondMasterSpec @@ -67,6 +81,7 @@ func (a bondMaster) Encode() ([]byte, error) { if bond.Mode == nethelpers.BondMode8023AD { encoder.Uint8(unix.IFLA_BOND_AD_LACP_RATE, uint8(bond.LACPRate)) + encoder.Uint8(unix.IFLA_BOND_AD_LACP_ACTIVE, uint8(bond.ADLACPActive)) } if bond.Mode != nethelpers.BondMode8023AD && bond.Mode != nethelpers.BondModeALB && bond.Mode != nethelpers.BondModeTLB { @@ -76,7 +91,9 @@ func (a bondMaster) Encode() ([]byte, error) { encoder.Uint32(unix.IFLA_BOND_ARP_ALL_TARGETS, uint32(bond.ARPAllTargets)) if bond.Mode == nethelpers.BondModeActiveBackup || bond.Mode == nethelpers.BondModeALB || bond.Mode == nethelpers.BondModeTLB { - encoder.Uint32(unix.IFLA_BOND_PRIMARY, bond.PrimaryIndex) + if bond.PrimaryIndex != nil { + encoder.Uint32(unix.IFLA_BOND_PRIMARY, *bond.PrimaryIndex) + } } encoder.Uint8(unix.IFLA_BOND_PRIMARY_RESELECT, uint8(bond.PrimaryReselect)) @@ -91,6 +108,32 @@ func (a bondMaster) Encode() ([]byte, error) { if bond.Mode != nethelpers.BondMode8023AD && bond.Mode != nethelpers.BondModeALB && bond.Mode != nethelpers.BondModeTLB { encoder.Uint32(unix.IFLA_BOND_ARP_INTERVAL, bond.ARPInterval) + + encoder.Nested(unix.IFLA_BOND_ARP_IP_TARGET, func(nae *netlink.AttributeEncoder) error { + for i, addr := range bond.ARPIPTargets { + if !addr.Is4() { + return fmt.Errorf("%s is not IPV4 address", addr) + } + + ip := addr.As4() + nae.Bytes(uint16(i), ip[:]) + } + + return nil + }) + + encoder.Nested(unix.IFLA_BOND_NS_IP6_TARGET, func(nae *netlink.AttributeEncoder) error { + for i, addr := range bond.NSIP6Targets { + if !addr.Is6() { + return fmt.Errorf("%s is not IPV6 address", addr) + } + + ip := addr.As16() + nae.Bytes(uint16(i), ip[:]) + } + + return nil + }) } encoder.Uint32(unix.IFLA_BOND_RESEND_IGMP, bond.ResendIGMP) @@ -126,6 +169,10 @@ func (a bondMaster) Encode() ([]byte, error) { encoder.Uint32(unix.IFLA_BOND_PEER_NOTIF_DELAY, bond.PeerNotifyDelay) } + if bond.MissedMax != 0 { + encoder.Uint8(unix.IFLA_BOND_MISSED_MAX, bond.MissedMax) + } + return encoder.Encode() } @@ -153,7 +200,7 @@ func (a bondMaster) Decode(data []byte) error { case unix.IFLA_BOND_ARP_ALL_TARGETS: bond.ARPAllTargets = nethelpers.ARPAllTargets(decoder.Uint32()) case unix.IFLA_BOND_PRIMARY: - bond.PrimaryIndex = decoder.Uint32() + bond.PrimaryIndex = pointer.To(decoder.Uint32()) case unix.IFLA_BOND_PRIMARY_RESELECT: bond.PrimaryReselect = nethelpers.PrimaryReselect(decoder.Uint8()) case unix.IFLA_BOND_FAIL_OVER_MAC: @@ -168,6 +215,34 @@ func (a bondMaster) Decode(data []byte) error { bond.DownDelay = decoder.Uint32() case unix.IFLA_BOND_ARP_INTERVAL: bond.ARPInterval = decoder.Uint32() + case unix.IFLA_BOND_ARP_IP_TARGET: + decoder.Nested(func(nad *netlink.AttributeDecoder) error { + for nad.Next() { + addr, ok := netip.AddrFromSlice(nad.Bytes()) + + if ok { + bond.ARPIPTargets = append(bond.ARPIPTargets, addr) + } else { + return fmt.Errorf("invalid ARP IP target") + } + } + + return nil + }) + case unix.IFLA_BOND_NS_IP6_TARGET: + decoder.Nested(func(nad *netlink.AttributeDecoder) error { + for nad.Next() { + addr, ok := netip.AddrFromSlice(nad.Bytes()) + + if ok { + bond.NSIP6Targets = append(bond.NSIP6Targets, addr) + } else { + return fmt.Errorf("invalid NS IP6 target") + } + } + + return nil + }) case unix.IFLA_BOND_RESEND_IGMP: bond.ResendIGMP = decoder.Uint32() case unix.IFLA_BOND_MIN_LINKS: @@ -190,6 +265,10 @@ func (a bondMaster) Decode(data []byte) error { bond.ADUserPortKey = decoder.Uint16() case unix.IFLA_BOND_PEER_NOTIF_DELAY: bond.PeerNotifyDelay = decoder.Uint32() + case unix.IFLA_BOND_AD_LACP_ACTIVE: + bond.ADLACPActive = nethelpers.ADLACPActive(decoder.Uint8()) + case unix.IFLA_BOND_MISSED_MAX: + bond.MissedMax = decoder.Uint8() } } diff --git a/internal/app/machined/pkg/controllers/network/cmdline.go b/internal/app/machined/pkg/controllers/network/cmdline.go index 2a6c55d5a..11c7665fa 100644 --- a/internal/app/machined/pkg/controllers/network/cmdline.go +++ b/internal/app/machined/pkg/controllers/network/cmdline.go @@ -284,7 +284,7 @@ func ParseCmdlineNetwork(cmdline *procfs.Cmdline, linkNameResolver *network.Link bondLinkSpec.MTU = uint32(mtu) } - if err := SetBondMaster(&bondLinkSpec, &bondOptions); err != nil { + if err := SetBondMasterLegacy(&bondLinkSpec, &bondOptions); err != nil { return settings, fmt.Errorf("error setting bond master: %w", err) } diff --git a/internal/app/machined/pkg/controllers/network/cmdline_test.go b/internal/app/machined/pkg/controllers/network/cmdline_test.go index 01827499c..b25b29908 100644 --- a/internal/app/machined/pkg/controllers/network/cmdline_test.go +++ b/internal/app/machined/pkg/controllers/network/cmdline_test.go @@ -13,6 +13,7 @@ import ( "slices" "testing" + "github.com/siderolabs/go-pointer" "github.com/siderolabs/go-procfs/procfs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -57,6 +58,9 @@ func TestCmdlineParse(t *testing.T) { NumPeerNotif: 1, TLBDynamicLB: 1, UseCarrier: true, + PrimaryIndex: pointer.To[uint32](0), + ADLACPActive: nethelpers.ADLACPActiveOn, + MissedMax: 2, }, }, { @@ -404,6 +408,8 @@ func TestCmdlineParse(t *testing.T) { NumPeerNotif: 1, TLBDynamicLB: 1, UseCarrier: true, + PrimaryIndex: pointer.To[uint32](0), + MissedMax: 2, }, }, { diff --git a/internal/app/machined/pkg/controllers/network/link_config.go b/internal/app/machined/pkg/controllers/network/link_config.go index d20f85c00..251672dac 100644 --- a/internal/app/machined/pkg/controllers/network/link_config.go +++ b/internal/app/machined/pkg/controllers/network/link_config.go @@ -16,6 +16,7 @@ import ( "github.com/siderolabs/gen/maps" "github.com/siderolabs/gen/optional" "github.com/siderolabs/gen/pair/ordered" + "github.com/siderolabs/gen/xslices" "github.com/siderolabs/go-procfs/procfs" "go.uber.org/zap" @@ -349,7 +350,7 @@ func (ctrl *LinkConfigController) processDevicesConfiguration( } if device.Bond() != nil { - if err := SetBondMaster(linkMap[deviceInterface], device.Bond()); err != nil { + if err := SetBondMasterLegacy(linkMap[deviceInterface], device.Bond()); err != nil { logger.Error("error parsing bond config", zap.Error(err)) } } @@ -444,7 +445,24 @@ func (ctrl *LinkConfigController) processLinkConfigs(logger *zap.Logger, linkMap case talosconfig.NetworkDummyLinkConfig: dummyLink(linkMap[linkName]) case talosconfig.NetworkVLANConfig: - vlanLink(linkMap[linkName], linkName, specificLinkConfig.ParentLink(), networkVLANConfigToVlaner{specificLinkConfig}) + parentLink := linkNameResolver.Resolve(specificLinkConfig.ParentLink()) + vlanLink(linkMap[linkName], linkName, parentLink, networkVLANConfigToVlaner{specificLinkConfig}) + case talosconfig.NetworkBondConfig: + SendBondMaster(linkMap[linkName], specificLinkConfig) + + bondedLinks := xslices.Map(specificLinkConfig.Links(), linkNameResolver.Resolve) + + for idx, slaveLinkName := range bondedLinks { + if _, exists := linkMap[slaveLinkName]; !exists { + linkMap[slaveLinkName] = &network.LinkSpecSpec{ + Name: slaveLinkName, + Up: true, + ConfigLayer: network.ConfigMachineConfiguration, + } + } + + SetBondSlave(linkMap[slaveLinkName], ordered.MakePair(linkName, idx)) + } default: logger.Error("unknown link config type", zap.String("linkName", linkName), zap.String("type", fmt.Sprintf("%T", specificLinkConfig))) } diff --git a/internal/app/machined/pkg/controllers/network/link_config_test.go b/internal/app/machined/pkg/controllers/network/link_config_test.go index 1d65c2d34..d29799edb 100644 --- a/internal/app/machined/pkg/controllers/network/link_config_test.go +++ b/internal/app/machined/pkg/controllers/network/link_config_test.go @@ -476,7 +476,15 @@ func (suite *LinkConfigSuite) TestMachineConfigurationNewStyle() { vl1.LinkMTU = 200 vl1.LinkUp = pointer.To(true) - ctr, err := container.New(dc1, lc1, vl1) + dc2 := networkcfg.NewDummyLinkConfigV1Alpha1("dummy2") + dc3 := networkcfg.NewDummyLinkConfigV1Alpha1("dummy3") + + bc1 := networkcfg.NewBondConfigV1Alpha1("bond357") + bc1.BondMode = pointer.To(nethelpers.BondModeActiveBackup) + bc1.BondLinks = []string{"dummy2", "dummy3"} + bc1.BondUpDelay = pointer.To(uint32(200)) + + ctr, err := container.New(dc1, lc1, vl1, dc2, dc3, bc1) suite.Require().NoError(err) cfg := config.NewMachineConfig(ctr) @@ -501,7 +509,10 @@ func (suite *LinkConfigSuite) TestMachineConfigurationNewStyle() { []string{ "configuration/eth0", "configuration/dummy1", + "configuration/dummy2", + "configuration/dummy3", "configuration/dummy1.100", + "configuration/bond357", }, func(r *network.LinkSpec, asrt *assert.Assertions) { asrt.Equal(network.ConfigMachineConfiguration, r.TypedSpec().ConfigLayer) @@ -510,11 +521,15 @@ func (suite *LinkConfigSuite) TestMachineConfigurationNewStyle() { asrt.True(r.TypedSpec().Up) asrt.False(r.TypedSpec().Logical) asrt.EqualValues(9001, r.TypedSpec().MTU) - case "dummy1": + case "dummy1", "dummy2", "dummy3": asrt.True(r.TypedSpec().Up) asrt.True(r.TypedSpec().Logical) asrt.Equal(nethelpers.LinkEther, r.TypedSpec().Type) asrt.Equal("dummy", r.TypedSpec().Kind) + + if r.TypedSpec().Name == "dummy2" || r.TypedSpec().Name == "dummy3" { + asrt.Equal("bond357", r.TypedSpec().BondSlave.MasterName) + } case "dummy1.100": asrt.True(r.TypedSpec().Up) asrt.True(r.TypedSpec().Logical) @@ -524,6 +539,13 @@ func (suite *LinkConfigSuite) TestMachineConfigurationNewStyle() { asrt.Equal(nethelpers.VLANProtocol8021AD, r.TypedSpec().VLAN.Protocol) asrt.EqualValues(100, r.TypedSpec().VLAN.VID) asrt.EqualValues(200, r.TypedSpec().MTU) + case "bond357": + asrt.True(r.TypedSpec().Up) + asrt.True(r.TypedSpec().Logical) + asrt.Equal(nethelpers.LinkEther, r.TypedSpec().Type) + asrt.Equal(network.LinkKindBond, r.TypedSpec().Kind) + asrt.Equal(nethelpers.BondModeActiveBackup, r.TypedSpec().BondMaster.Mode) + asrt.EqualValues(200, r.TypedSpec().BondMaster.UpDelay) } }, ) diff --git a/internal/app/machined/pkg/controllers/network/link_spec.go b/internal/app/machined/pkg/controllers/network/link_spec.go index b37eb7021..ab7b556f5 100644 --- a/internal/app/machined/pkg/controllers/network/link_spec.go +++ b/internal/app/machined/pkg/controllers/network/link_spec.go @@ -393,7 +393,12 @@ func (ctrl *LinkSpecController) syncLink(ctx context.Context, r controller.Runti return fmt.Errorf("error parsing bond attributes for %q: %w", link.TypedSpec().Name, err) } - if existingBond != link.TypedSpec().BondMaster { + // primaryIndex might be reported from the kernel, but if it's nil in the spec, we should treat it as equal + if existingBond.PrimaryIndex != nil && link.TypedSpec().BondMaster.PrimaryIndex == nil { + existingBond.PrimaryIndex = nil + } + + if !existingBond.Equal(&link.TypedSpec().BondMaster) { logger.Debug("updating bond settings", zap.String("old", fmt.Sprintf("%+v", existingBond)), zap.String("new", fmt.Sprintf("%+v", link.TypedSpec().BondMaster)), diff --git a/internal/app/machined/pkg/controllers/network/network.go b/internal/app/machined/pkg/controllers/network/network.go index 881299cb8..51747f1e2 100644 --- a/internal/app/machined/pkg/controllers/network/network.go +++ b/internal/app/machined/pkg/controllers/network/network.go @@ -9,6 +9,7 @@ import ( "net" "github.com/siderolabs/gen/pair/ordered" + "github.com/siderolabs/go-pointer" networkadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/network" talosconfig "github.com/siderolabs/talos/pkg/machinery/config/config" @@ -24,10 +25,46 @@ func SetBondSlave(link *network.LinkSpecSpec, bond ordered.Pair[string, int]) { } } -// SetBondMaster sets the bond master spec. +// SendBondMaster sets the bond master spec. +func SendBondMaster(link *network.LinkSpecSpec, bond talosconfig.NetworkBondConfig) { + link.Logical = true + link.Kind = network.LinkKindBond + link.Type = nethelpers.LinkEther + link.BondMaster.Mode = bond.Mode() + link.BondMaster.MIIMon = bond.MIIMon().ValueOrZero() + link.BondMaster.UpDelay = bond.UpDelay().ValueOrZero() + link.BondMaster.DownDelay = bond.DownDelay().ValueOrZero() + link.BondMaster.UseCarrier = bond.UseCarrier().ValueOrZero() + link.BondMaster.HashPolicy = bond.XmitHashPolicy().ValueOrZero() + link.BondMaster.ARPInterval = bond.ARPInterval().ValueOrZero() + link.BondMaster.ARPIPTargets = bond.ARPIPTargets() + link.BondMaster.NSIP6Targets = bond.NSIP6Targets() + link.BondMaster.ARPValidate = bond.ARPValidate().ValueOrZero() + link.BondMaster.ARPAllTargets = bond.ARPAllTargets().ValueOrZero() + link.BondMaster.LACPRate = bond.LACPRate().ValueOrZero() + link.BondMaster.FailOverMac = bond.FailOverMAC().ValueOrZero() + link.BondMaster.ADSelect = bond.ADSelect().ValueOrZero() + link.BondMaster.ADActorSysPrio = bond.ADActorSysPrio().ValueOrZero() + link.BondMaster.ADUserPortKey = bond.ADUserPortKey().ValueOrZero() + link.BondMaster.ADLACPActive = bond.ADLACPActive().ValueOrZero() + link.BondMaster.PrimaryReselect = bond.PrimaryReselect().ValueOrZero() + link.BondMaster.ResendIGMP = bond.ResendIGMP().ValueOrZero() + link.BondMaster.MinLinks = bond.MinLinks().ValueOrZero() + link.BondMaster.LPInterval = bond.LPInterval().ValueOrZero() + link.BondMaster.PacketsPerSlave = bond.PacketsPerSlave().ValueOrZero() + link.BondMaster.NumPeerNotif = bond.NumPeerNotif().ValueOrZero() + link.BondMaster.TLBDynamicLB = bond.TLBDynamicLB().ValueOrZero() + link.BondMaster.AllSlavesActive = bond.AllSlavesActive().ValueOrZero() + link.BondMaster.PeerNotifyDelay = bond.PeerNotifyDelay().ValueOrZero() + link.BondMaster.MissedMax = bond.MissedMax().ValueOrZero() + + networkadapter.BondMasterSpec(&link.BondMaster).FillDefaults() +} + +// SetBondMasterLegacy sets the bond master spec. // //nolint:gocyclo -func SetBondMaster(link *network.LinkSpecSpec, bond talosconfig.Bond) error { +func SetBondMasterLegacy(link *network.LinkSpecSpec, bond talosconfig.Bond) error { link.Logical = true link.Kind = network.LinkKindBond link.Type = nethelpers.LinkEther @@ -91,7 +128,7 @@ func SetBondMaster(link *network.LinkSpecSpec, bond talosconfig.Bond) error { LACPRate: lacpRate, ARPValidate: arpValidate, ARPAllTargets: arpAllTargets, - PrimaryIndex: primary, + PrimaryIndex: pointer.To(primary), PrimaryReselect: primaryReselect, FailOverMac: failOverMAC, ADSelect: adSelect, diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected-2bonds.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected-2bonds.yaml index 04f0f9acb..72c49f029 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected-2bonds.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected-2bonds.yaml @@ -75,6 +75,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform - name: bond1 logical: true @@ -99,6 +100,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform routes: - family: inet4 diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected.yaml index c6870e9b8..f9b5a8841 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/testdata/expected.yaml @@ -58,6 +58,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform routes: - family: inet4 diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v1-pnap.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v1-pnap.yaml index e8aee81a8..cb40d070b 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v1-pnap.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v1-pnap.yaml @@ -50,6 +50,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform - name: bond0.2 logical: true diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2-serverscom.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2-serverscom.yaml index c8a4e19dd..3830f53a7 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2-serverscom.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2-serverscom.yaml @@ -69,6 +69,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform - name: aggi logical: true @@ -93,6 +94,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform routes: - family: inet4 diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2.yaml index 3a9065633..0678b5f9b 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/expected-v2.yaml @@ -84,6 +84,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform - name: bond0.4 logical: true diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/testdata/expected.yaml b/internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/testdata/expected.yaml index 189858959..893866cd7 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/testdata/expected.yaml +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/testdata/expected.yaml @@ -53,6 +53,7 @@ links: numPeerNotif: 1 tlbLogicalLb: 1 adActorSysPrio: 65535 + missedMax: 2 layer: platform - name: eth0 logical: false diff --git a/internal/integration/api/network-config.go b/internal/integration/api/network-config.go index 408759911..f8f681107 100644 --- a/internal/integration/api/network-config.go +++ b/internal/integration/api/network-config.go @@ -12,12 +12,14 @@ import ( "fmt" "math/rand/v2" "net/netip" + "strconv" "strings" "time" "github.com/cosi-project/runtime/pkg/resource" "github.com/cosi-project/runtime/pkg/resource/rtestutils" "github.com/cosi-project/runtime/pkg/safe" + "github.com/siderolabs/gen/xslices" "github.com/siderolabs/go-pointer" "github.com/stretchr/testify/assert" @@ -429,6 +431,101 @@ func (suite *NetworkConfigSuite) TestVLANConfig() { rtestutils.AssertNoResource[*networkres.RouteStatus](nodeCtx, suite.T(), suite.Client.COSI, routeID) } +// TestBondConfig tests creation of bond interfaces. +func (suite *NetworkConfigSuite) TestBondConfig() { + if suite.Cluster == nil { + suite.T().Skip("skipping if cluster is not qemu/docker") + } + + node := suite.RandomDiscoveredNodeInternalIP(machine.TypeWorker) + nodeCtx := client.WithNode(suite.ctx, node) + + suite.T().Logf("testing on node %q", node) + + dummyNames := xslices.Map([]int{0, 1}, func(int) string { + return fmt.Sprintf("dummy%d", rand.IntN(10000)) + }) + + dummyConfigs := xslices.Map(dummyNames, func(name string) any { + return network.NewDummyLinkConfigV1Alpha1(name) + }) + + bondName := "agg." + strconv.Itoa(rand.IntN(10000)) + + bond := network.NewBondConfigV1Alpha1(bondName) + bond.BondLinks = dummyNames + bond.BondMode = pointer.To(nethelpers.BondMode8023AD) + bond.BondMIIMon = pointer.To(uint32(100)) + bond.BondUpDelay = pointer.To(uint32(200)) + bond.BondDownDelay = pointer.To(uint32(300)) + bond.BondLACPRate = pointer.To(nethelpers.LACPRateSlow) + bond.BondADActorSysPrio = pointer.To(uint16(65535)) + bond.BondResendIGMP = pointer.To(uint32(1)) + bond.BondPacketsPerSlave = pointer.To(uint32(1)) + bond.HardwareAddressConfig = nethelpers.HardwareAddr{0x02, 0x00, 0x00, 0x00, byte(rand.IntN(256)), byte(rand.IntN(256))} + bond.LinkUp = pointer.To(true) + bond.LinkMTU = 2000 + bond.LinkAddresses = []network.AddressConfig{ + { + AddressAddress: netip.MustParsePrefix("fd13:1235::1/64"), + AddressPriority: pointer.To[uint32](100), + }, + } + bond.LinkRoutes = []network.RouteConfig{ + { + RouteDestination: network.Prefix{Prefix: netip.MustParsePrefix("fd13:1236::/64")}, + RouteGateway: network.Addr{Addr: netip.MustParseAddr("fd13:1235::ffff")}, + }, + } + + addressID := bondName + "/fd13:1235::1/64" + routeID := bondName + "/inet6/fd13:1235::ffff/fd13:1236::/64/1024" + addressRouteID := bondName + "/inet6//fd13:1235::/64/100" + + suite.PatchMachineConfig(nodeCtx, append(dummyConfigs, bond)...) + + rtestutils.AssertResources(nodeCtx, suite.T(), suite.Client.COSI, dummyNames, + func(link *networkres.LinkStatus, asrt *assert.Assertions) { + asrt.Equal("dummy", link.TypedSpec().Kind) + asrt.NotZero(link.TypedSpec().MasterIndex) + }, + ) + + rtestutils.AssertResource(nodeCtx, suite.T(), suite.Client.COSI, bondName, + func(link *networkres.LinkStatus, asrt *assert.Assertions) { + asrt.Equal("bond", link.TypedSpec().Kind) + asrt.Equal(bond.LinkMTU, link.TypedSpec().MTU) + asrt.Equal(nethelpers.BondMode8023AD, link.TypedSpec().BondMaster.Mode) + asrt.Equal(bond.HardwareAddressConfig, link.TypedSpec().HardwareAddr) + }, + ) + + rtestutils.AssertResource(nodeCtx, suite.T(), suite.Client.COSI, addressID, + func(addr *networkres.AddressStatus, asrt *assert.Assertions) { + asrt.Equal(bondName, addr.TypedSpec().LinkName) + }, + ) + + rtestutils.AssertResources(nodeCtx, suite.T(), suite.Client.COSI, + []resource.ID{routeID, addressRouteID}, + func(route *networkres.RouteStatus, asrt *assert.Assertions) { + asrt.Equal(bondName, route.TypedSpec().OutLinkName) + }, + ) + + suite.RemoveMachineConfigDocumentsByName(nodeCtx, network.BondKind, bondName) + suite.RemoveMachineConfigDocumentsByName(nodeCtx, network.DummyLinkKind, dummyNames...) + + for _, dummyName := range dummyNames { + rtestutils.AssertNoResource[*networkres.LinkStatus](nodeCtx, suite.T(), suite.Client.COSI, dummyName) + } + + rtestutils.AssertNoResource[*networkres.LinkStatus](nodeCtx, suite.T(), suite.Client.COSI, bondName) + rtestutils.AssertNoResource[*networkres.AddressStatus](nodeCtx, suite.T(), suite.Client.COSI, addressID) + rtestutils.AssertNoResource[*networkres.RouteStatus](nodeCtx, suite.T(), suite.Client.COSI, addressRouteID) + rtestutils.AssertNoResource[*networkres.RouteStatus](nodeCtx, suite.T(), suite.Client.COSI, routeID) +} + func init() { allSuites = append(allSuites, new(NetworkConfigSuite)) } diff --git a/pkg/machinery/api/resource/definitions/enums/enums.pb.go b/pkg/machinery/api/resource/definitions/enums/enums.pb.go index 8de701ab6..8e5dd2f76 100644 --- a/pkg/machinery/api/resource/definitions/enums/enums.pb.go +++ b/pkg/machinery/api/resource/definitions/enums/enums.pb.go @@ -377,6 +377,53 @@ func (NethelpersAddressSortAlgorithm) EnumDescriptor() ([]byte, []int) { return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{5} } +// NethelpersADLACPActive is ADLACPActive. +type NethelpersADLACPActive int32 + +const ( + NethelpersADLACPActive_ADLACP_ACTIVE_OFF NethelpersADLACPActive = 0 + NethelpersADLACPActive_ADLACP_ACTIVE_ON NethelpersADLACPActive = 1 +) + +// Enum value maps for NethelpersADLACPActive. +var ( + NethelpersADLACPActive_name = map[int32]string{ + 0: "ADLACP_ACTIVE_OFF", + 1: "ADLACP_ACTIVE_ON", + } + NethelpersADLACPActive_value = map[string]int32{ + "ADLACP_ACTIVE_OFF": 0, + "ADLACP_ACTIVE_ON": 1, + } +) + +func (x NethelpersADLACPActive) Enum() *NethelpersADLACPActive { + p := new(NethelpersADLACPActive) + *p = x + return p +} + +func (x NethelpersADLACPActive) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NethelpersADLACPActive) Descriptor() protoreflect.EnumDescriptor { + return file_resource_definitions_enums_enums_proto_enumTypes[6].Descriptor() +} + +func (NethelpersADLACPActive) Type() protoreflect.EnumType { + return &file_resource_definitions_enums_enums_proto_enumTypes[6] +} + +func (x NethelpersADLACPActive) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use NethelpersADLACPActive.Descriptor instead. +func (NethelpersADLACPActive) EnumDescriptor() ([]byte, []int) { + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{6} +} + // NethelpersADSelect is ADSelect. type NethelpersADSelect int32 @@ -411,11 +458,11 @@ func (x NethelpersADSelect) String() string { } func (NethelpersADSelect) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[6].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[7].Descriptor() } func (NethelpersADSelect) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[6] + return &file_resource_definitions_enums_enums_proto_enumTypes[7] } func (x NethelpersADSelect) Number() protoreflect.EnumNumber { @@ -424,7 +471,7 @@ func (x NethelpersADSelect) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersADSelect.Descriptor instead. func (NethelpersADSelect) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{6} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{7} } // NethelpersARPAllTargets is an ARP targets mode. @@ -458,11 +505,11 @@ func (x NethelpersARPAllTargets) String() string { } func (NethelpersARPAllTargets) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[7].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[8].Descriptor() } func (NethelpersARPAllTargets) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[7] + return &file_resource_definitions_enums_enums_proto_enumTypes[8] } func (x NethelpersARPAllTargets) Number() protoreflect.EnumNumber { @@ -471,17 +518,20 @@ func (x NethelpersARPAllTargets) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersARPAllTargets.Descriptor instead. func (NethelpersARPAllTargets) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{7} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{8} } // NethelpersARPValidate is an ARP Validation mode. type NethelpersARPValidate int32 const ( - NethelpersARPValidate_ARP_VALIDATE_NONE NethelpersARPValidate = 0 - NethelpersARPValidate_ARP_VALIDATE_ACTIVE NethelpersARPValidate = 1 - NethelpersARPValidate_ARP_VALIDATE_BACKUP NethelpersARPValidate = 2 - NethelpersARPValidate_ARP_VALIDATE_ALL NethelpersARPValidate = 3 + NethelpersARPValidate_ARP_VALIDATE_NONE NethelpersARPValidate = 0 + NethelpersARPValidate_ARP_VALIDATE_ACTIVE NethelpersARPValidate = 1 + NethelpersARPValidate_ARP_VALIDATE_BACKUP NethelpersARPValidate = 2 + NethelpersARPValidate_ARP_VALIDATE_ALL NethelpersARPValidate = 3 + NethelpersARPValidate_ARP_VALIDATE_FILTER NethelpersARPValidate = 4 + NethelpersARPValidate_ARP_VALIDATE_FILTER_ACTIVE NethelpersARPValidate = 5 + NethelpersARPValidate_ARP_VALIDATE_FILTER_BACKUP NethelpersARPValidate = 6 ) // Enum value maps for NethelpersARPValidate. @@ -491,12 +541,18 @@ var ( 1: "ARP_VALIDATE_ACTIVE", 2: "ARP_VALIDATE_BACKUP", 3: "ARP_VALIDATE_ALL", + 4: "ARP_VALIDATE_FILTER", + 5: "ARP_VALIDATE_FILTER_ACTIVE", + 6: "ARP_VALIDATE_FILTER_BACKUP", } NethelpersARPValidate_value = map[string]int32{ - "ARP_VALIDATE_NONE": 0, - "ARP_VALIDATE_ACTIVE": 1, - "ARP_VALIDATE_BACKUP": 2, - "ARP_VALIDATE_ALL": 3, + "ARP_VALIDATE_NONE": 0, + "ARP_VALIDATE_ACTIVE": 1, + "ARP_VALIDATE_BACKUP": 2, + "ARP_VALIDATE_ALL": 3, + "ARP_VALIDATE_FILTER": 4, + "ARP_VALIDATE_FILTER_ACTIVE": 5, + "ARP_VALIDATE_FILTER_BACKUP": 6, } ) @@ -511,11 +567,11 @@ func (x NethelpersARPValidate) String() string { } func (NethelpersARPValidate) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[8].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[9].Descriptor() } func (NethelpersARPValidate) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[8] + return &file_resource_definitions_enums_enums_proto_enumTypes[9] } func (x NethelpersARPValidate) Number() protoreflect.EnumNumber { @@ -524,7 +580,7 @@ func (x NethelpersARPValidate) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersARPValidate.Descriptor instead. func (NethelpersARPValidate) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{8} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{9} } // NethelpersAutoHostnameKind is a kind of automatically generated hostname. @@ -561,11 +617,11 @@ func (x NethelpersAutoHostnameKind) String() string { } func (NethelpersAutoHostnameKind) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[9].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[10].Descriptor() } func (NethelpersAutoHostnameKind) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[9] + return &file_resource_definitions_enums_enums_proto_enumTypes[10] } func (x NethelpersAutoHostnameKind) Number() protoreflect.EnumNumber { @@ -574,7 +630,7 @@ func (x NethelpersAutoHostnameKind) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersAutoHostnameKind.Descriptor instead. func (NethelpersAutoHostnameKind) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{9} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{10} } // NethelpersBondMode is a bond mode. @@ -623,11 +679,11 @@ func (x NethelpersBondMode) String() string { } func (NethelpersBondMode) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[10].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[11].Descriptor() } func (NethelpersBondMode) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[10] + return &file_resource_definitions_enums_enums_proto_enumTypes[11] } func (x NethelpersBondMode) Number() protoreflect.EnumNumber { @@ -636,7 +692,7 @@ func (x NethelpersBondMode) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersBondMode.Descriptor instead. func (NethelpersBondMode) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{10} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{11} } // NethelpersBondXmitHashPolicy is a bond hash policy. @@ -679,11 +735,11 @@ func (x NethelpersBondXmitHashPolicy) String() string { } func (NethelpersBondXmitHashPolicy) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[11].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[12].Descriptor() } func (NethelpersBondXmitHashPolicy) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[11] + return &file_resource_definitions_enums_enums_proto_enumTypes[12] } func (x NethelpersBondXmitHashPolicy) Number() protoreflect.EnumNumber { @@ -692,7 +748,7 @@ func (x NethelpersBondXmitHashPolicy) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersBondXmitHashPolicy.Descriptor instead. func (NethelpersBondXmitHashPolicy) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{11} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{12} } // NethelpersClientIdentifier is a DHCP client identifier. @@ -729,11 +785,11 @@ func (x NethelpersClientIdentifier) String() string { } func (NethelpersClientIdentifier) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[12].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[13].Descriptor() } func (NethelpersClientIdentifier) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[12] + return &file_resource_definitions_enums_enums_proto_enumTypes[13] } func (x NethelpersClientIdentifier) Number() protoreflect.EnumNumber { @@ -742,7 +798,7 @@ func (x NethelpersClientIdentifier) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersClientIdentifier.Descriptor instead. func (NethelpersClientIdentifier) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{12} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{13} } // NethelpersConntrackState is a conntrack state. @@ -785,11 +841,11 @@ func (x NethelpersConntrackState) String() string { } func (NethelpersConntrackState) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[13].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[14].Descriptor() } func (NethelpersConntrackState) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[13] + return &file_resource_definitions_enums_enums_proto_enumTypes[14] } func (x NethelpersConntrackState) Number() protoreflect.EnumNumber { @@ -798,7 +854,7 @@ func (x NethelpersConntrackState) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersConntrackState.Descriptor instead. func (NethelpersConntrackState) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{13} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{14} } // NethelpersDuplex wraps ethtool.Duplex for YAML marshaling. @@ -835,11 +891,11 @@ func (x NethelpersDuplex) String() string { } func (NethelpersDuplex) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[14].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[15].Descriptor() } func (NethelpersDuplex) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[14] + return &file_resource_definitions_enums_enums_proto_enumTypes[15] } func (x NethelpersDuplex) Number() protoreflect.EnumNumber { @@ -848,7 +904,7 @@ func (x NethelpersDuplex) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersDuplex.Descriptor instead. func (NethelpersDuplex) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{14} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{15} } // NethelpersFailOverMAC is a MAC failover mode. @@ -885,11 +941,11 @@ func (x NethelpersFailOverMAC) String() string { } func (NethelpersFailOverMAC) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[15].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[16].Descriptor() } func (NethelpersFailOverMAC) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[15] + return &file_resource_definitions_enums_enums_proto_enumTypes[16] } func (x NethelpersFailOverMAC) Number() protoreflect.EnumNumber { @@ -898,7 +954,7 @@ func (x NethelpersFailOverMAC) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersFailOverMAC.Descriptor instead. func (NethelpersFailOverMAC) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{15} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{16} } // NethelpersFamily is a network family. @@ -935,11 +991,11 @@ func (x NethelpersFamily) String() string { } func (NethelpersFamily) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[16].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[17].Descriptor() } func (NethelpersFamily) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[16] + return &file_resource_definitions_enums_enums_proto_enumTypes[17] } func (x NethelpersFamily) Number() protoreflect.EnumNumber { @@ -948,7 +1004,7 @@ func (x NethelpersFamily) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersFamily.Descriptor instead. func (NethelpersFamily) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{16} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{17} } // NethelpersICMPType is a ICMP packet type. @@ -991,11 +1047,11 @@ func (x NethelpersICMPType) String() string { } func (NethelpersICMPType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[17].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[18].Descriptor() } func (NethelpersICMPType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[17] + return &file_resource_definitions_enums_enums_proto_enumTypes[18] } func (x NethelpersICMPType) Number() protoreflect.EnumNumber { @@ -1004,7 +1060,7 @@ func (x NethelpersICMPType) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersICMPType.Descriptor instead. func (NethelpersICMPType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{17} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{18} } // NethelpersLACPRate is a LACP rate. @@ -1038,11 +1094,11 @@ func (x NethelpersLACPRate) String() string { } func (NethelpersLACPRate) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[18].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[19].Descriptor() } func (NethelpersLACPRate) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[18] + return &file_resource_definitions_enums_enums_proto_enumTypes[19] } func (x NethelpersLACPRate) Number() protoreflect.EnumNumber { @@ -1051,7 +1107,7 @@ func (x NethelpersLACPRate) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersLACPRate.Descriptor instead. func (NethelpersLACPRate) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{18} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{19} } // NethelpersLinkType is a link type. @@ -1310,11 +1366,11 @@ func (x NethelpersLinkType) String() string { } func (NethelpersLinkType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[19].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[20].Descriptor() } func (NethelpersLinkType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[19] + return &file_resource_definitions_enums_enums_proto_enumTypes[20] } func (x NethelpersLinkType) Number() protoreflect.EnumNumber { @@ -1323,7 +1379,7 @@ func (x NethelpersLinkType) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersLinkType.Descriptor instead. func (NethelpersLinkType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{19} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{20} } // NethelpersMatchOperator is a netfilter match operator. @@ -1357,11 +1413,11 @@ func (x NethelpersMatchOperator) String() string { } func (NethelpersMatchOperator) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[20].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[21].Descriptor() } func (NethelpersMatchOperator) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[20] + return &file_resource_definitions_enums_enums_proto_enumTypes[21] } func (x NethelpersMatchOperator) Number() protoreflect.EnumNumber { @@ -1370,7 +1426,7 @@ func (x NethelpersMatchOperator) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersMatchOperator.Descriptor instead. func (NethelpersMatchOperator) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{20} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{21} } // NethelpersNfTablesChainHook wraps nftables.ChainHook for YAML marshaling. @@ -1413,11 +1469,11 @@ func (x NethelpersNfTablesChainHook) String() string { } func (NethelpersNfTablesChainHook) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[21].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[22].Descriptor() } func (NethelpersNfTablesChainHook) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[21] + return &file_resource_definitions_enums_enums_proto_enumTypes[22] } func (x NethelpersNfTablesChainHook) Number() protoreflect.EnumNumber { @@ -1426,7 +1482,7 @@ func (x NethelpersNfTablesChainHook) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersNfTablesChainHook.Descriptor instead. func (NethelpersNfTablesChainHook) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{21} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{22} } // NethelpersNfTablesChainPriority wraps nftables.ChainPriority for YAML marshaling. @@ -1496,11 +1552,11 @@ func (x NethelpersNfTablesChainPriority) String() string { } func (NethelpersNfTablesChainPriority) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[22].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[23].Descriptor() } func (NethelpersNfTablesChainPriority) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[22] + return &file_resource_definitions_enums_enums_proto_enumTypes[23] } func (x NethelpersNfTablesChainPriority) Number() protoreflect.EnumNumber { @@ -1509,7 +1565,7 @@ func (x NethelpersNfTablesChainPriority) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersNfTablesChainPriority.Descriptor instead. func (NethelpersNfTablesChainPriority) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{22} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{23} } // NethelpersNfTablesVerdict wraps nftables.Verdict for YAML marshaling. @@ -1543,11 +1599,11 @@ func (x NethelpersNfTablesVerdict) String() string { } func (NethelpersNfTablesVerdict) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[23].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[24].Descriptor() } func (NethelpersNfTablesVerdict) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[23] + return &file_resource_definitions_enums_enums_proto_enumTypes[24] } func (x NethelpersNfTablesVerdict) Number() protoreflect.EnumNumber { @@ -1556,7 +1612,7 @@ func (x NethelpersNfTablesVerdict) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersNfTablesVerdict.Descriptor instead. func (NethelpersNfTablesVerdict) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{23} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{24} } // NethelpersOperationalState wraps rtnetlink.OperationalState for YAML marshaling. @@ -1605,11 +1661,11 @@ func (x NethelpersOperationalState) String() string { } func (NethelpersOperationalState) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[24].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[25].Descriptor() } func (NethelpersOperationalState) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[24] + return &file_resource_definitions_enums_enums_proto_enumTypes[25] } func (x NethelpersOperationalState) Number() protoreflect.EnumNumber { @@ -1618,7 +1674,7 @@ func (x NethelpersOperationalState) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersOperationalState.Descriptor instead. func (NethelpersOperationalState) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{24} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{25} } // NethelpersPort wraps ethtool.Port for YAML marshaling. @@ -1670,11 +1726,11 @@ func (x NethelpersPort) String() string { } func (NethelpersPort) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[25].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[26].Descriptor() } func (NethelpersPort) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[25] + return &file_resource_definitions_enums_enums_proto_enumTypes[26] } func (x NethelpersPort) Number() protoreflect.EnumNumber { @@ -1683,7 +1739,7 @@ func (x NethelpersPort) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersPort.Descriptor instead. func (NethelpersPort) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{25} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{26} } // NethelpersPrimaryReselect is an ARP targets mode. @@ -1720,11 +1776,11 @@ func (x NethelpersPrimaryReselect) String() string { } func (NethelpersPrimaryReselect) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[26].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[27].Descriptor() } func (NethelpersPrimaryReselect) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[26] + return &file_resource_definitions_enums_enums_proto_enumTypes[27] } func (x NethelpersPrimaryReselect) Number() protoreflect.EnumNumber { @@ -1733,7 +1789,7 @@ func (x NethelpersPrimaryReselect) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersPrimaryReselect.Descriptor instead. func (NethelpersPrimaryReselect) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{26} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{27} } // NethelpersProtocol is a inet protocol. @@ -1776,11 +1832,11 @@ func (x NethelpersProtocol) String() string { } func (NethelpersProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[27].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[28].Descriptor() } func (NethelpersProtocol) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[27] + return &file_resource_definitions_enums_enums_proto_enumTypes[28] } func (x NethelpersProtocol) Number() protoreflect.EnumNumber { @@ -1789,7 +1845,7 @@ func (x NethelpersProtocol) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersProtocol.Descriptor instead. func (NethelpersProtocol) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{27} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{28} } // NethelpersRouteFlag wraps RTM_F_* constants. @@ -1844,11 +1900,11 @@ func (x NethelpersRouteFlag) String() string { } func (NethelpersRouteFlag) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[28].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[29].Descriptor() } func (NethelpersRouteFlag) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[28] + return &file_resource_definitions_enums_enums_proto_enumTypes[29] } func (x NethelpersRouteFlag) Number() protoreflect.EnumNumber { @@ -1857,7 +1913,7 @@ func (x NethelpersRouteFlag) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersRouteFlag.Descriptor instead. func (NethelpersRouteFlag) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{28} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{29} } // NethelpersRouteProtocol is a routing protocol. @@ -1951,11 +2007,11 @@ func (x NethelpersRouteProtocol) String() string { } func (NethelpersRouteProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[29].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[30].Descriptor() } func (NethelpersRouteProtocol) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[29] + return &file_resource_definitions_enums_enums_proto_enumTypes[30] } func (x NethelpersRouteProtocol) Number() protoreflect.EnumNumber { @@ -1964,7 +2020,7 @@ func (x NethelpersRouteProtocol) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersRouteProtocol.Descriptor instead. func (NethelpersRouteProtocol) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{29} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{30} } // NethelpersRouteType is a route type. @@ -2028,11 +2084,11 @@ func (x NethelpersRouteType) String() string { } func (NethelpersRouteType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[30].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[31].Descriptor() } func (NethelpersRouteType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[30] + return &file_resource_definitions_enums_enums_proto_enumTypes[31] } func (x NethelpersRouteType) Number() protoreflect.EnumNumber { @@ -2041,7 +2097,7 @@ func (x NethelpersRouteType) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersRouteType.Descriptor instead. func (NethelpersRouteType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{30} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{31} } // NethelpersRoutingTable is a routing table ID. @@ -2837,11 +2893,11 @@ func (x NethelpersRoutingTable) String() string { } func (NethelpersRoutingTable) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[31].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[32].Descriptor() } func (NethelpersRoutingTable) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[31] + return &file_resource_definitions_enums_enums_proto_enumTypes[32] } func (x NethelpersRoutingTable) Number() protoreflect.EnumNumber { @@ -2850,7 +2906,7 @@ func (x NethelpersRoutingTable) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersRoutingTable.Descriptor instead. func (NethelpersRoutingTable) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{31} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{32} } // NethelpersScope is an address scope. @@ -2893,11 +2949,11 @@ func (x NethelpersScope) String() string { } func (NethelpersScope) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[32].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[33].Descriptor() } func (NethelpersScope) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[32] + return &file_resource_definitions_enums_enums_proto_enumTypes[33] } func (x NethelpersScope) Number() protoreflect.EnumNumber { @@ -2906,7 +2962,7 @@ func (x NethelpersScope) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersScope.Descriptor instead. func (NethelpersScope) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{32} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{33} } // NethelpersVLANProtocol is a VLAN protocol. @@ -2943,11 +2999,11 @@ func (x NethelpersVLANProtocol) String() string { } func (NethelpersVLANProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[33].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[34].Descriptor() } func (NethelpersVLANProtocol) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[33] + return &file_resource_definitions_enums_enums_proto_enumTypes[34] } func (x NethelpersVLANProtocol) Number() protoreflect.EnumNumber { @@ -2956,7 +3012,7 @@ func (x NethelpersVLANProtocol) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersVLANProtocol.Descriptor instead. func (NethelpersVLANProtocol) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{33} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{34} } // NethelpersWOLMode wraps ethtool.WOLMode for YAML marshaling. @@ -3008,11 +3064,11 @@ func (x NethelpersWOLMode) String() string { } func (NethelpersWOLMode) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[34].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[35].Descriptor() } func (NethelpersWOLMode) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[34] + return &file_resource_definitions_enums_enums_proto_enumTypes[35] } func (x NethelpersWOLMode) Number() protoreflect.EnumNumber { @@ -3021,7 +3077,7 @@ func (x NethelpersWOLMode) Number() protoreflect.EnumNumber { // Deprecated: Use NethelpersWOLMode.Descriptor instead. func (NethelpersWOLMode) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{34} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{35} } // BlockEncryptionKeyType describes encryption key type. @@ -3061,11 +3117,11 @@ func (x BlockEncryptionKeyType) String() string { } func (BlockEncryptionKeyType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[35].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[36].Descriptor() } func (BlockEncryptionKeyType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[35] + return &file_resource_definitions_enums_enums_proto_enumTypes[36] } func (x BlockEncryptionKeyType) Number() protoreflect.EnumNumber { @@ -3074,7 +3130,7 @@ func (x BlockEncryptionKeyType) Number() protoreflect.EnumNumber { // Deprecated: Use BlockEncryptionKeyType.Descriptor instead. func (BlockEncryptionKeyType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{35} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{36} } // BlockEncryptionProviderType describes encryption provider type. @@ -3108,11 +3164,11 @@ func (x BlockEncryptionProviderType) String() string { } func (BlockEncryptionProviderType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[36].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[37].Descriptor() } func (BlockEncryptionProviderType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[36] + return &file_resource_definitions_enums_enums_proto_enumTypes[37] } func (x BlockEncryptionProviderType) Number() protoreflect.EnumNumber { @@ -3121,7 +3177,7 @@ func (x BlockEncryptionProviderType) Number() protoreflect.EnumNumber { // Deprecated: Use BlockEncryptionProviderType.Descriptor instead. func (BlockEncryptionProviderType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{36} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{37} } // BlockFilesystemType describes filesystem type. @@ -3167,11 +3223,11 @@ func (x BlockFilesystemType) String() string { } func (BlockFilesystemType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[37].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[38].Descriptor() } func (BlockFilesystemType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[37] + return &file_resource_definitions_enums_enums_proto_enumTypes[38] } func (x BlockFilesystemType) Number() protoreflect.EnumNumber { @@ -3180,7 +3236,7 @@ func (x BlockFilesystemType) Number() protoreflect.EnumNumber { // Deprecated: Use BlockFilesystemType.Descriptor instead. func (BlockFilesystemType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{37} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{38} } // BlockVolumePhase describes volume phase. @@ -3232,11 +3288,11 @@ func (x BlockVolumePhase) String() string { } func (BlockVolumePhase) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[38].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[39].Descriptor() } func (BlockVolumePhase) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[38] + return &file_resource_definitions_enums_enums_proto_enumTypes[39] } func (x BlockVolumePhase) Number() protoreflect.EnumNumber { @@ -3245,7 +3301,7 @@ func (x BlockVolumePhase) Number() protoreflect.EnumNumber { // Deprecated: Use BlockVolumePhase.Descriptor instead. func (BlockVolumePhase) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{38} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{39} } // BlockVolumeType describes volume type. @@ -3291,11 +3347,11 @@ func (x BlockVolumeType) String() string { } func (BlockVolumeType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[39].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[40].Descriptor() } func (BlockVolumeType) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[39] + return &file_resource_definitions_enums_enums_proto_enumTypes[40] } func (x BlockVolumeType) Number() protoreflect.EnumNumber { @@ -3304,7 +3360,7 @@ func (x BlockVolumeType) Number() protoreflect.EnumNumber { // Deprecated: Use BlockVolumeType.Descriptor instead. func (BlockVolumeType) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{39} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{40} } // CriImageCacheStatus describes image cache status type. @@ -3344,11 +3400,11 @@ func (x CriImageCacheStatus) String() string { } func (CriImageCacheStatus) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[40].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[41].Descriptor() } func (CriImageCacheStatus) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[40] + return &file_resource_definitions_enums_enums_proto_enumTypes[41] } func (x CriImageCacheStatus) Number() protoreflect.EnumNumber { @@ -3357,7 +3413,7 @@ func (x CriImageCacheStatus) Number() protoreflect.EnumNumber { // Deprecated: Use CriImageCacheStatus.Descriptor instead. func (CriImageCacheStatus) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{40} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{41} } // CriImageCacheCopyStatus describes image cache copy status type. @@ -3397,11 +3453,11 @@ func (x CriImageCacheCopyStatus) String() string { } func (CriImageCacheCopyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[41].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[42].Descriptor() } func (CriImageCacheCopyStatus) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[41] + return &file_resource_definitions_enums_enums_proto_enumTypes[42] } func (x CriImageCacheCopyStatus) Number() protoreflect.EnumNumber { @@ -3410,7 +3466,7 @@ func (x CriImageCacheCopyStatus) Number() protoreflect.EnumNumber { // Deprecated: Use CriImageCacheCopyStatus.Descriptor instead. func (CriImageCacheCopyStatus) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{41} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{42} } // KubespanPeerState is KubeSpan peer current state. @@ -3447,11 +3503,11 @@ func (x KubespanPeerState) String() string { } func (KubespanPeerState) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[42].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[43].Descriptor() } func (KubespanPeerState) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[42] + return &file_resource_definitions_enums_enums_proto_enumTypes[43] } func (x KubespanPeerState) Number() protoreflect.EnumNumber { @@ -3460,7 +3516,7 @@ func (x KubespanPeerState) Number() protoreflect.EnumNumber { // Deprecated: Use KubespanPeerState.Descriptor instead. func (KubespanPeerState) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{42} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{43} } // NetworkConfigLayer describes network configuration layers, with lowest priority first. @@ -3503,11 +3559,11 @@ func (x NetworkConfigLayer) String() string { } func (NetworkConfigLayer) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[43].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[44].Descriptor() } func (NetworkConfigLayer) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[43] + return &file_resource_definitions_enums_enums_proto_enumTypes[44] } func (x NetworkConfigLayer) Number() protoreflect.EnumNumber { @@ -3516,7 +3572,7 @@ func (x NetworkConfigLayer) Number() protoreflect.EnumNumber { // Deprecated: Use NetworkConfigLayer.Descriptor instead. func (NetworkConfigLayer) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{43} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{44} } // NetworkOperator enumerates Talos network operators. @@ -3553,11 +3609,11 @@ func (x NetworkOperator) String() string { } func (NetworkOperator) Descriptor() protoreflect.EnumDescriptor { - return file_resource_definitions_enums_enums_proto_enumTypes[44].Descriptor() + return file_resource_definitions_enums_enums_proto_enumTypes[45].Descriptor() } func (NetworkOperator) Type() protoreflect.EnumType { - return &file_resource_definitions_enums_enums_proto_enumTypes[44] + return &file_resource_definitions_enums_enums_proto_enumTypes[45] } func (x NetworkOperator) Number() protoreflect.EnumNumber { @@ -3566,7 +3622,7 @@ func (x NetworkOperator) Number() protoreflect.EnumNumber { // Deprecated: Use NetworkOperator.Descriptor instead. func (NetworkOperator) EnumDescriptor() ([]byte, []int) { - return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{44} + return file_resource_definitions_enums_enums_proto_rawDescGZIP(), []int{45} } var File_resource_definitions_enums_enums_proto protoreflect.FileDescriptor @@ -3613,19 +3669,25 @@ const file_resource_definitions_enums_enums_proto_rawDesc = "" + "\x16ADDRESS_STABLE_PRIVACY\x10\x80\x10*^\n" + "\x1eNethelpersAddressSortAlgorithm\x12\x1d\n" + "\x19ADDRESS_SORT_ALGORITHM_V1\x10\x00\x12\x1d\n" + - "\x19ADDRESS_SORT_ALGORITHM_V2\x10\x01*X\n" + + "\x19ADDRESS_SORT_ALGORITHM_V2\x10\x01*E\n" + + "\x16NethelpersADLACPActive\x12\x15\n" + + "\x11ADLACP_ACTIVE_OFF\x10\x00\x12\x14\n" + + "\x10ADLACP_ACTIVE_ON\x10\x01*X\n" + "\x12NethelpersADSelect\x12\x14\n" + "\x10AD_SELECT_STABLE\x10\x00\x12\x17\n" + "\x13AD_SELECT_BANDWIDTH\x10\x01\x12\x13\n" + "\x0fAD_SELECT_COUNT\x10\x02*K\n" + "\x17NethelpersARPAllTargets\x12\x17\n" + "\x13ARP_ALL_TARGETS_ANY\x10\x00\x12\x17\n" + - "\x13ARP_ALL_TARGETS_ALL\x10\x01*v\n" + + "\x13ARP_ALL_TARGETS_ALL\x10\x01*\xcf\x01\n" + "\x15NethelpersARPValidate\x12\x15\n" + "\x11ARP_VALIDATE_NONE\x10\x00\x12\x17\n" + "\x13ARP_VALIDATE_ACTIVE\x10\x01\x12\x17\n" + "\x13ARP_VALIDATE_BACKUP\x10\x02\x12\x14\n" + - "\x10ARP_VALIDATE_ALL\x10\x03*t\n" + + "\x10ARP_VALIDATE_ALL\x10\x03\x12\x17\n" + + "\x13ARP_VALIDATE_FILTER\x10\x04\x12\x1e\n" + + "\x1aARP_VALIDATE_FILTER_ACTIVE\x10\x05\x12\x1e\n" + + "\x1aARP_VALIDATE_FILTER_BACKUP\x10\x06*t\n" + "\x1aNethelpersAutoHostnameKind\x12\x1a\n" + "\x16AUTO_HOSTNAME_KIND_OFF\x10\x00\x12\x1b\n" + "\x17AUTO_HOSTNAME_KIND_ADDR\x10\x01\x12\x1d\n" + @@ -4233,7 +4295,7 @@ func file_resource_definitions_enums_enums_proto_rawDescGZIP() []byte { return file_resource_definitions_enums_enums_proto_rawDescData } -var file_resource_definitions_enums_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 45) +var file_resource_definitions_enums_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 46) var file_resource_definitions_enums_enums_proto_goTypes = []any{ (RuntimeMachineStage)(0), // 0: talos.resource.definitions.enums.RuntimeMachineStage (RuntimeSELinuxState)(0), // 1: talos.resource.definitions.enums.RuntimeSELinuxState @@ -4241,45 +4303,46 @@ var file_resource_definitions_enums_enums_proto_goTypes = []any{ (MachineType)(0), // 3: talos.resource.definitions.enums.MachineType (NethelpersAddressFlag)(0), // 4: talos.resource.definitions.enums.NethelpersAddressFlag (NethelpersAddressSortAlgorithm)(0), // 5: talos.resource.definitions.enums.NethelpersAddressSortAlgorithm - (NethelpersADSelect)(0), // 6: talos.resource.definitions.enums.NethelpersADSelect - (NethelpersARPAllTargets)(0), // 7: talos.resource.definitions.enums.NethelpersARPAllTargets - (NethelpersARPValidate)(0), // 8: talos.resource.definitions.enums.NethelpersARPValidate - (NethelpersAutoHostnameKind)(0), // 9: talos.resource.definitions.enums.NethelpersAutoHostnameKind - (NethelpersBondMode)(0), // 10: talos.resource.definitions.enums.NethelpersBondMode - (NethelpersBondXmitHashPolicy)(0), // 11: talos.resource.definitions.enums.NethelpersBondXmitHashPolicy - (NethelpersClientIdentifier)(0), // 12: talos.resource.definitions.enums.NethelpersClientIdentifier - (NethelpersConntrackState)(0), // 13: talos.resource.definitions.enums.NethelpersConntrackState - (NethelpersDuplex)(0), // 14: talos.resource.definitions.enums.NethelpersDuplex - (NethelpersFailOverMAC)(0), // 15: talos.resource.definitions.enums.NethelpersFailOverMAC - (NethelpersFamily)(0), // 16: talos.resource.definitions.enums.NethelpersFamily - (NethelpersICMPType)(0), // 17: talos.resource.definitions.enums.NethelpersICMPType - (NethelpersLACPRate)(0), // 18: talos.resource.definitions.enums.NethelpersLACPRate - (NethelpersLinkType)(0), // 19: talos.resource.definitions.enums.NethelpersLinkType - (NethelpersMatchOperator)(0), // 20: talos.resource.definitions.enums.NethelpersMatchOperator - (NethelpersNfTablesChainHook)(0), // 21: talos.resource.definitions.enums.NethelpersNfTablesChainHook - (NethelpersNfTablesChainPriority)(0), // 22: talos.resource.definitions.enums.NethelpersNfTablesChainPriority - (NethelpersNfTablesVerdict)(0), // 23: talos.resource.definitions.enums.NethelpersNfTablesVerdict - (NethelpersOperationalState)(0), // 24: talos.resource.definitions.enums.NethelpersOperationalState - (NethelpersPort)(0), // 25: talos.resource.definitions.enums.NethelpersPort - (NethelpersPrimaryReselect)(0), // 26: talos.resource.definitions.enums.NethelpersPrimaryReselect - (NethelpersProtocol)(0), // 27: talos.resource.definitions.enums.NethelpersProtocol - (NethelpersRouteFlag)(0), // 28: talos.resource.definitions.enums.NethelpersRouteFlag - (NethelpersRouteProtocol)(0), // 29: talos.resource.definitions.enums.NethelpersRouteProtocol - (NethelpersRouteType)(0), // 30: talos.resource.definitions.enums.NethelpersRouteType - (NethelpersRoutingTable)(0), // 31: talos.resource.definitions.enums.NethelpersRoutingTable - (NethelpersScope)(0), // 32: talos.resource.definitions.enums.NethelpersScope - (NethelpersVLANProtocol)(0), // 33: talos.resource.definitions.enums.NethelpersVLANProtocol - (NethelpersWOLMode)(0), // 34: talos.resource.definitions.enums.NethelpersWOLMode - (BlockEncryptionKeyType)(0), // 35: talos.resource.definitions.enums.BlockEncryptionKeyType - (BlockEncryptionProviderType)(0), // 36: talos.resource.definitions.enums.BlockEncryptionProviderType - (BlockFilesystemType)(0), // 37: talos.resource.definitions.enums.BlockFilesystemType - (BlockVolumePhase)(0), // 38: talos.resource.definitions.enums.BlockVolumePhase - (BlockVolumeType)(0), // 39: talos.resource.definitions.enums.BlockVolumeType - (CriImageCacheStatus)(0), // 40: talos.resource.definitions.enums.CriImageCacheStatus - (CriImageCacheCopyStatus)(0), // 41: talos.resource.definitions.enums.CriImageCacheCopyStatus - (KubespanPeerState)(0), // 42: talos.resource.definitions.enums.KubespanPeerState - (NetworkConfigLayer)(0), // 43: talos.resource.definitions.enums.NetworkConfigLayer - (NetworkOperator)(0), // 44: talos.resource.definitions.enums.NetworkOperator + (NethelpersADLACPActive)(0), // 6: talos.resource.definitions.enums.NethelpersADLACPActive + (NethelpersADSelect)(0), // 7: talos.resource.definitions.enums.NethelpersADSelect + (NethelpersARPAllTargets)(0), // 8: talos.resource.definitions.enums.NethelpersARPAllTargets + (NethelpersARPValidate)(0), // 9: talos.resource.definitions.enums.NethelpersARPValidate + (NethelpersAutoHostnameKind)(0), // 10: talos.resource.definitions.enums.NethelpersAutoHostnameKind + (NethelpersBondMode)(0), // 11: talos.resource.definitions.enums.NethelpersBondMode + (NethelpersBondXmitHashPolicy)(0), // 12: talos.resource.definitions.enums.NethelpersBondXmitHashPolicy + (NethelpersClientIdentifier)(0), // 13: talos.resource.definitions.enums.NethelpersClientIdentifier + (NethelpersConntrackState)(0), // 14: talos.resource.definitions.enums.NethelpersConntrackState + (NethelpersDuplex)(0), // 15: talos.resource.definitions.enums.NethelpersDuplex + (NethelpersFailOverMAC)(0), // 16: talos.resource.definitions.enums.NethelpersFailOverMAC + (NethelpersFamily)(0), // 17: talos.resource.definitions.enums.NethelpersFamily + (NethelpersICMPType)(0), // 18: talos.resource.definitions.enums.NethelpersICMPType + (NethelpersLACPRate)(0), // 19: talos.resource.definitions.enums.NethelpersLACPRate + (NethelpersLinkType)(0), // 20: talos.resource.definitions.enums.NethelpersLinkType + (NethelpersMatchOperator)(0), // 21: talos.resource.definitions.enums.NethelpersMatchOperator + (NethelpersNfTablesChainHook)(0), // 22: talos.resource.definitions.enums.NethelpersNfTablesChainHook + (NethelpersNfTablesChainPriority)(0), // 23: talos.resource.definitions.enums.NethelpersNfTablesChainPriority + (NethelpersNfTablesVerdict)(0), // 24: talos.resource.definitions.enums.NethelpersNfTablesVerdict + (NethelpersOperationalState)(0), // 25: talos.resource.definitions.enums.NethelpersOperationalState + (NethelpersPort)(0), // 26: talos.resource.definitions.enums.NethelpersPort + (NethelpersPrimaryReselect)(0), // 27: talos.resource.definitions.enums.NethelpersPrimaryReselect + (NethelpersProtocol)(0), // 28: talos.resource.definitions.enums.NethelpersProtocol + (NethelpersRouteFlag)(0), // 29: talos.resource.definitions.enums.NethelpersRouteFlag + (NethelpersRouteProtocol)(0), // 30: talos.resource.definitions.enums.NethelpersRouteProtocol + (NethelpersRouteType)(0), // 31: talos.resource.definitions.enums.NethelpersRouteType + (NethelpersRoutingTable)(0), // 32: talos.resource.definitions.enums.NethelpersRoutingTable + (NethelpersScope)(0), // 33: talos.resource.definitions.enums.NethelpersScope + (NethelpersVLANProtocol)(0), // 34: talos.resource.definitions.enums.NethelpersVLANProtocol + (NethelpersWOLMode)(0), // 35: talos.resource.definitions.enums.NethelpersWOLMode + (BlockEncryptionKeyType)(0), // 36: talos.resource.definitions.enums.BlockEncryptionKeyType + (BlockEncryptionProviderType)(0), // 37: talos.resource.definitions.enums.BlockEncryptionProviderType + (BlockFilesystemType)(0), // 38: talos.resource.definitions.enums.BlockFilesystemType + (BlockVolumePhase)(0), // 39: talos.resource.definitions.enums.BlockVolumePhase + (BlockVolumeType)(0), // 40: talos.resource.definitions.enums.BlockVolumeType + (CriImageCacheStatus)(0), // 41: talos.resource.definitions.enums.CriImageCacheStatus + (CriImageCacheCopyStatus)(0), // 42: talos.resource.definitions.enums.CriImageCacheCopyStatus + (KubespanPeerState)(0), // 43: talos.resource.definitions.enums.KubespanPeerState + (NetworkConfigLayer)(0), // 44: talos.resource.definitions.enums.NetworkConfigLayer + (NetworkOperator)(0), // 45: talos.resource.definitions.enums.NetworkOperator } var file_resource_definitions_enums_enums_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -4299,7 +4362,7 @@ func file_resource_definitions_enums_enums_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_resource_definitions_enums_enums_proto_rawDesc), len(file_resource_definitions_enums_enums_proto_rawDesc)), - NumEnums: 45, + NumEnums: 46, NumMessages: 0, NumExtensions: 0, NumServices: 0, diff --git a/pkg/machinery/api/resource/definitions/network/network.pb.go b/pkg/machinery/api/resource/definitions/network/network.pb.go index 4e2f6f6cc..bf28976ef 100644 --- a/pkg/machinery/api/resource/definitions/network/network.pb.go +++ b/pkg/machinery/api/resource/definitions/network/network.pb.go @@ -280,6 +280,10 @@ type BondMasterSpec struct { AdActorSysPrio uint32 `protobuf:"varint,22,opt,name=ad_actor_sys_prio,json=adActorSysPrio,proto3" json:"ad_actor_sys_prio,omitempty"` AdUserPortKey uint32 `protobuf:"varint,23,opt,name=ad_user_port_key,json=adUserPortKey,proto3" json:"ad_user_port_key,omitempty"` PeerNotifyDelay uint32 `protobuf:"varint,24,opt,name=peer_notify_delay,json=peerNotifyDelay,proto3" json:"peer_notify_delay,omitempty"` + ArpipTargets []*common.NetIP `protobuf:"bytes,25,rep,name=arpip_targets,json=arpipTargets,proto3" json:"arpip_targets,omitempty"` + Nsip6Targets []*common.NetIP `protobuf:"bytes,26,rep,name=nsip6_targets,json=nsip6Targets,proto3" json:"nsip6_targets,omitempty"` + AdlacpActive enums.NethelpersADLACPActive `protobuf:"varint,27,opt,name=adlacp_active,json=adlacpActive,proto3,enum=talos.resource.definitions.enums.NethelpersADLACPActive" json:"adlacp_active,omitempty"` + MissedMax uint32 `protobuf:"varint,28,opt,name=missed_max,json=missedMax,proto3" json:"missed_max,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -482,6 +486,34 @@ func (x *BondMasterSpec) GetPeerNotifyDelay() uint32 { return 0 } +func (x *BondMasterSpec) GetArpipTargets() []*common.NetIP { + if x != nil { + return x.ArpipTargets + } + return nil +} + +func (x *BondMasterSpec) GetNsip6Targets() []*common.NetIP { + if x != nil { + return x.Nsip6Targets + } + return nil +} + +func (x *BondMasterSpec) GetAdlacpActive() enums.NethelpersADLACPActive { + if x != nil { + return x.AdlacpActive + } + return enums.NethelpersADLACPActive(0) +} + +func (x *BondMasterSpec) GetMissedMax() uint32 { + if x != nil { + return x.MissedMax + } + return 0 +} + // BondSlave contains a bond's master name and slave index. type BondSlave struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -4673,8 +4705,7 @@ const file_resource_definitions_network_network_proto_rawDesc = "" + "\x05scope\x18\t \x01(\x0e21.talos.resource.definitions.enums.NethelpersScopeR\x05scope\x12\x14\n" + "\x05flags\x18\n" + " \x01(\rR\x05flags\x12\x1a\n" + - "\bpriority\x18\v \x01(\rR\bpriority\"\xa4\n" + - "\n" + + "\bpriority\x18\v \x01(\rR\bpriority\"\x8a\f\n" + "\x0eBondMasterSpec\x12H\n" + "\x04mode\x18\x01 \x01(\x0e24.talos.resource.definitions.enums.NethelpersBondModeR\x04mode\x12_\n" + "\vhash_policy\x18\x02 \x01(\x0e2>.talos.resource.definitions.enums.NethelpersBondXmitHashPolicyR\n" + @@ -4705,7 +4736,12 @@ const file_resource_definitions_network_network_proto_rawDesc = "" + "useCarrier\x12)\n" + "\x11ad_actor_sys_prio\x18\x16 \x01(\rR\x0eadActorSysPrio\x12'\n" + "\x10ad_user_port_key\x18\x17 \x01(\rR\radUserPortKey\x12*\n" + - "\x11peer_notify_delay\x18\x18 \x01(\rR\x0fpeerNotifyDelay\"M\n" + + "\x11peer_notify_delay\x18\x18 \x01(\rR\x0fpeerNotifyDelay\x122\n" + + "\rarpip_targets\x18\x19 \x03(\v2\r.common.NetIPR\farpipTargets\x122\n" + + "\rnsip6_targets\x18\x1a \x03(\v2\r.common.NetIPR\fnsip6Targets\x12]\n" + + "\radlacp_active\x18\x1b \x01(\x0e28.talos.resource.definitions.enums.NethelpersADLACPActiveR\fadlacpActive\x12\x1d\n" + + "\n" + + "missed_max\x18\x1c \x01(\rR\tmissedMax\"M\n" + "\tBondSlave\x12\x1f\n" + "\vmaster_name\x18\x01 \x01(\tR\n" + "masterName\x12\x1f\n" + @@ -5161,28 +5197,29 @@ var file_resource_definitions_network_network_proto_goTypes = []any{ (enums.NethelpersPrimaryReselect)(0), // 71: talos.resource.definitions.enums.NethelpersPrimaryReselect (enums.NethelpersFailOverMAC)(0), // 72: talos.resource.definitions.enums.NethelpersFailOverMAC (enums.NethelpersADSelect)(0), // 73: talos.resource.definitions.enums.NethelpersADSelect - (enums.NethelpersClientIdentifier)(0), // 74: talos.resource.definitions.enums.NethelpersClientIdentifier - (enums.NethelpersWOLMode)(0), // 75: talos.resource.definitions.enums.NethelpersWOLMode - (enums.NethelpersPort)(0), // 76: talos.resource.definitions.enums.NethelpersPort - (enums.NethelpersDuplex)(0), // 77: talos.resource.definitions.enums.NethelpersDuplex - (*common.NetIPPort)(nil), // 78: common.NetIPPort - (enums.NethelpersLinkType)(0), // 79: talos.resource.definitions.enums.NethelpersLinkType - (enums.NethelpersOperationalState)(0), // 80: talos.resource.definitions.enums.NethelpersOperationalState - (enums.NethelpersNfTablesChainHook)(0), // 81: talos.resource.definitions.enums.NethelpersNfTablesChainHook - (enums.NethelpersNfTablesChainPriority)(0), // 82: talos.resource.definitions.enums.NethelpersNfTablesChainPriority - (enums.NethelpersNfTablesVerdict)(0), // 83: talos.resource.definitions.enums.NethelpersNfTablesVerdict - (enums.NethelpersConntrackState)(0), // 84: talos.resource.definitions.enums.NethelpersConntrackState - (enums.NethelpersICMPType)(0), // 85: talos.resource.definitions.enums.NethelpersICMPType - (enums.NethelpersMatchOperator)(0), // 86: talos.resource.definitions.enums.NethelpersMatchOperator - (enums.NethelpersProtocol)(0), // 87: talos.resource.definitions.enums.NethelpersProtocol - (enums.NethelpersAddressSortAlgorithm)(0), // 88: talos.resource.definitions.enums.NethelpersAddressSortAlgorithm - (enums.NetworkOperator)(0), // 89: talos.resource.definitions.enums.NetworkOperator - (*runtime.PlatformMetadataSpec)(nil), // 90: talos.resource.definitions.runtime.PlatformMetadataSpec - (*durationpb.Duration)(nil), // 91: google.protobuf.Duration - (enums.NethelpersRoutingTable)(0), // 92: talos.resource.definitions.enums.NethelpersRoutingTable - (enums.NethelpersRouteType)(0), // 93: talos.resource.definitions.enums.NethelpersRouteType - (enums.NethelpersRouteProtocol)(0), // 94: talos.resource.definitions.enums.NethelpersRouteProtocol - (enums.NethelpersVLANProtocol)(0), // 95: talos.resource.definitions.enums.NethelpersVLANProtocol + (enums.NethelpersADLACPActive)(0), // 74: talos.resource.definitions.enums.NethelpersADLACPActive + (enums.NethelpersClientIdentifier)(0), // 75: talos.resource.definitions.enums.NethelpersClientIdentifier + (enums.NethelpersWOLMode)(0), // 76: talos.resource.definitions.enums.NethelpersWOLMode + (enums.NethelpersPort)(0), // 77: talos.resource.definitions.enums.NethelpersPort + (enums.NethelpersDuplex)(0), // 78: talos.resource.definitions.enums.NethelpersDuplex + (*common.NetIPPort)(nil), // 79: common.NetIPPort + (enums.NethelpersLinkType)(0), // 80: talos.resource.definitions.enums.NethelpersLinkType + (enums.NethelpersOperationalState)(0), // 81: talos.resource.definitions.enums.NethelpersOperationalState + (enums.NethelpersNfTablesChainHook)(0), // 82: talos.resource.definitions.enums.NethelpersNfTablesChainHook + (enums.NethelpersNfTablesChainPriority)(0), // 83: talos.resource.definitions.enums.NethelpersNfTablesChainPriority + (enums.NethelpersNfTablesVerdict)(0), // 84: talos.resource.definitions.enums.NethelpersNfTablesVerdict + (enums.NethelpersConntrackState)(0), // 85: talos.resource.definitions.enums.NethelpersConntrackState + (enums.NethelpersICMPType)(0), // 86: talos.resource.definitions.enums.NethelpersICMPType + (enums.NethelpersMatchOperator)(0), // 87: talos.resource.definitions.enums.NethelpersMatchOperator + (enums.NethelpersProtocol)(0), // 88: talos.resource.definitions.enums.NethelpersProtocol + (enums.NethelpersAddressSortAlgorithm)(0), // 89: talos.resource.definitions.enums.NethelpersAddressSortAlgorithm + (enums.NetworkOperator)(0), // 90: talos.resource.definitions.enums.NetworkOperator + (*runtime.PlatformMetadataSpec)(nil), // 91: talos.resource.definitions.runtime.PlatformMetadataSpec + (*durationpb.Duration)(nil), // 92: google.protobuf.Duration + (enums.NethelpersRoutingTable)(0), // 93: talos.resource.definitions.enums.NethelpersRoutingTable + (enums.NethelpersRouteType)(0), // 94: talos.resource.definitions.enums.NethelpersRouteType + (enums.NethelpersRouteProtocol)(0), // 95: talos.resource.definitions.enums.NethelpersRouteProtocol + (enums.NethelpersVLANProtocol)(0), // 96: talos.resource.definitions.enums.NethelpersVLANProtocol } var file_resource_definitions_network_network_proto_depIdxs = []int32{ 61, // 0: talos.resource.definitions.network.AddressSpecSpec.address:type_name -> common.NetIPPrefix @@ -5204,122 +5241,125 @@ var file_resource_definitions_network_network_proto_depIdxs = []int32{ 71, // 16: talos.resource.definitions.network.BondMasterSpec.primary_reselect:type_name -> talos.resource.definitions.enums.NethelpersPrimaryReselect 72, // 17: talos.resource.definitions.network.BondMasterSpec.fail_over_mac:type_name -> talos.resource.definitions.enums.NethelpersFailOverMAC 73, // 18: talos.resource.definitions.network.BondMasterSpec.ad_select:type_name -> talos.resource.definitions.enums.NethelpersADSelect - 49, // 19: talos.resource.definitions.network.BridgeMasterSpec.stp:type_name -> talos.resource.definitions.network.STPSpec - 6, // 20: talos.resource.definitions.network.BridgeMasterSpec.vlan:type_name -> talos.resource.definitions.network.BridgeVLANSpec - 74, // 21: talos.resource.definitions.network.ClientIdentifierSpec.client_identifier:type_name -> talos.resource.definitions.enums.NethelpersClientIdentifier - 7, // 22: talos.resource.definitions.network.DHCP4OperatorSpec.client_identifier:type_name -> talos.resource.definitions.network.ClientIdentifierSpec - 7, // 23: talos.resource.definitions.network.DHCP6OperatorSpec.client_identifier:type_name -> talos.resource.definitions.network.ClientIdentifierSpec - 14, // 24: talos.resource.definitions.network.EthernetSpecSpec.rings:type_name -> talos.resource.definitions.network.EthernetRingsSpec - 60, // 25: talos.resource.definitions.network.EthernetSpecSpec.features:type_name -> talos.resource.definitions.network.EthernetSpecSpec.FeaturesEntry - 11, // 26: talos.resource.definitions.network.EthernetSpecSpec.channels:type_name -> talos.resource.definitions.network.EthernetChannelsSpec - 75, // 27: talos.resource.definitions.network.EthernetSpecSpec.wake_on_lan:type_name -> talos.resource.definitions.enums.NethelpersWOLMode - 76, // 28: talos.resource.definitions.network.EthernetStatusSpec.port:type_name -> talos.resource.definitions.enums.NethelpersPort - 77, // 29: talos.resource.definitions.network.EthernetStatusSpec.duplex:type_name -> talos.resource.definitions.enums.NethelpersDuplex - 15, // 30: talos.resource.definitions.network.EthernetStatusSpec.rings:type_name -> talos.resource.definitions.network.EthernetRingsStatus - 13, // 31: talos.resource.definitions.network.EthernetStatusSpec.features:type_name -> talos.resource.definitions.network.EthernetFeatureStatus - 12, // 32: talos.resource.definitions.network.EthernetStatusSpec.channels:type_name -> talos.resource.definitions.network.EthernetChannelsStatus - 75, // 33: talos.resource.definitions.network.EthernetStatusSpec.wake_on_lan:type_name -> talos.resource.definitions.enums.NethelpersWOLMode - 78, // 34: talos.resource.definitions.network.HostDNSConfigSpec.listen_addresses:type_name -> common.NetIPPort - 65, // 35: talos.resource.definitions.network.HostDNSConfigSpec.service_host_dns_address:type_name -> common.NetIP - 64, // 36: talos.resource.definitions.network.HostnameSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 79, // 37: talos.resource.definitions.network.LinkSpecSpec.type:type_name -> talos.resource.definitions.enums.NethelpersLinkType - 3, // 38: talos.resource.definitions.network.LinkSpecSpec.bond_slave:type_name -> talos.resource.definitions.network.BondSlave - 5, // 39: talos.resource.definitions.network.LinkSpecSpec.bridge_slave:type_name -> talos.resource.definitions.network.BridgeSlave - 57, // 40: talos.resource.definitions.network.LinkSpecSpec.vlan:type_name -> talos.resource.definitions.network.VLANSpec - 2, // 41: talos.resource.definitions.network.LinkSpecSpec.bond_master:type_name -> talos.resource.definitions.network.BondMasterSpec - 4, // 42: talos.resource.definitions.network.LinkSpecSpec.bridge_master:type_name -> talos.resource.definitions.network.BridgeMasterSpec - 59, // 43: talos.resource.definitions.network.LinkSpecSpec.wireguard:type_name -> talos.resource.definitions.network.WireguardSpec - 64, // 44: talos.resource.definitions.network.LinkSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 79, // 45: talos.resource.definitions.network.LinkStatusSpec.type:type_name -> talos.resource.definitions.enums.NethelpersLinkType - 80, // 46: talos.resource.definitions.network.LinkStatusSpec.operational_state:type_name -> talos.resource.definitions.enums.NethelpersOperationalState - 76, // 47: talos.resource.definitions.network.LinkStatusSpec.port:type_name -> talos.resource.definitions.enums.NethelpersPort - 77, // 48: talos.resource.definitions.network.LinkStatusSpec.duplex:type_name -> talos.resource.definitions.enums.NethelpersDuplex - 57, // 49: talos.resource.definitions.network.LinkStatusSpec.vlan:type_name -> talos.resource.definitions.network.VLANSpec - 4, // 50: talos.resource.definitions.network.LinkStatusSpec.bridge_master:type_name -> talos.resource.definitions.network.BridgeMasterSpec - 2, // 51: talos.resource.definitions.network.LinkStatusSpec.bond_master:type_name -> talos.resource.definitions.network.BondMasterSpec - 59, // 52: talos.resource.definitions.network.LinkStatusSpec.wireguard:type_name -> talos.resource.definitions.network.WireguardSpec - 61, // 53: talos.resource.definitions.network.NfTablesAddressMatch.include_subnets:type_name -> common.NetIPPrefix - 61, // 54: talos.resource.definitions.network.NfTablesAddressMatch.exclude_subnets:type_name -> common.NetIPPrefix - 81, // 55: talos.resource.definitions.network.NfTablesChainSpec.hook:type_name -> talos.resource.definitions.enums.NethelpersNfTablesChainHook - 82, // 56: talos.resource.definitions.network.NfTablesChainSpec.priority:type_name -> talos.resource.definitions.enums.NethelpersNfTablesChainPriority - 36, // 57: talos.resource.definitions.network.NfTablesChainSpec.rules:type_name -> talos.resource.definitions.network.NfTablesRule - 83, // 58: talos.resource.definitions.network.NfTablesChainSpec.policy:type_name -> talos.resource.definitions.enums.NethelpersNfTablesVerdict - 84, // 59: talos.resource.definitions.network.NfTablesConntrackStateMatch.states:type_name -> talos.resource.definitions.enums.NethelpersConntrackState - 85, // 60: talos.resource.definitions.network.NfTablesICMPTypeMatch.types:type_name -> talos.resource.definitions.enums.NethelpersICMPType - 86, // 61: talos.resource.definitions.network.NfTablesIfNameMatch.operator:type_name -> talos.resource.definitions.enums.NethelpersMatchOperator - 87, // 62: talos.resource.definitions.network.NfTablesLayer4Match.protocol:type_name -> talos.resource.definitions.enums.NethelpersProtocol - 35, // 63: talos.resource.definitions.network.NfTablesLayer4Match.match_source_port:type_name -> talos.resource.definitions.network.NfTablesPortMatch - 35, // 64: talos.resource.definitions.network.NfTablesLayer4Match.match_destination_port:type_name -> talos.resource.definitions.network.NfTablesPortMatch - 30, // 65: talos.resource.definitions.network.NfTablesLayer4Match.match_icmp_type:type_name -> talos.resource.definitions.network.NfTablesICMPTypeMatch - 42, // 66: talos.resource.definitions.network.NfTablesPortMatch.ranges:type_name -> talos.resource.definitions.network.PortRange - 31, // 67: talos.resource.definitions.network.NfTablesRule.match_o_if_name:type_name -> talos.resource.definitions.network.NfTablesIfNameMatch - 83, // 68: talos.resource.definitions.network.NfTablesRule.verdict:type_name -> talos.resource.definitions.enums.NethelpersNfTablesVerdict - 34, // 69: talos.resource.definitions.network.NfTablesRule.match_mark:type_name -> talos.resource.definitions.network.NfTablesMark - 34, // 70: talos.resource.definitions.network.NfTablesRule.set_mark:type_name -> talos.resource.definitions.network.NfTablesMark - 26, // 71: talos.resource.definitions.network.NfTablesRule.match_source_address:type_name -> talos.resource.definitions.network.NfTablesAddressMatch - 26, // 72: talos.resource.definitions.network.NfTablesRule.match_destination_address:type_name -> talos.resource.definitions.network.NfTablesAddressMatch - 32, // 73: talos.resource.definitions.network.NfTablesRule.match_layer4:type_name -> talos.resource.definitions.network.NfTablesLayer4Match - 31, // 74: talos.resource.definitions.network.NfTablesRule.match_i_if_name:type_name -> talos.resource.definitions.network.NfTablesIfNameMatch - 28, // 75: talos.resource.definitions.network.NfTablesRule.clamp_mss:type_name -> talos.resource.definitions.network.NfTablesClampMSS - 33, // 76: talos.resource.definitions.network.NfTablesRule.match_limit:type_name -> talos.resource.definitions.network.NfTablesLimitMatch - 29, // 77: talos.resource.definitions.network.NfTablesRule.match_conntrack_state:type_name -> talos.resource.definitions.network.NfTablesConntrackStateMatch - 61, // 78: talos.resource.definitions.network.NodeAddressFilterSpec.include_subnets:type_name -> common.NetIPPrefix - 61, // 79: talos.resource.definitions.network.NodeAddressFilterSpec.exclude_subnets:type_name -> common.NetIPPrefix - 88, // 80: talos.resource.definitions.network.NodeAddressSortAlgorithmSpec.algorithm:type_name -> talos.resource.definitions.enums.NethelpersAddressSortAlgorithm - 61, // 81: talos.resource.definitions.network.NodeAddressSpec.addresses:type_name -> common.NetIPPrefix - 88, // 82: talos.resource.definitions.network.NodeAddressSpec.sort_algorithm:type_name -> talos.resource.definitions.enums.NethelpersAddressSortAlgorithm - 89, // 83: talos.resource.definitions.network.OperatorSpecSpec.operator:type_name -> talos.resource.definitions.enums.NetworkOperator - 8, // 84: talos.resource.definitions.network.OperatorSpecSpec.dhcp4:type_name -> talos.resource.definitions.network.DHCP4OperatorSpec - 9, // 85: talos.resource.definitions.network.OperatorSpecSpec.dhcp6:type_name -> talos.resource.definitions.network.DHCP6OperatorSpec - 56, // 86: talos.resource.definitions.network.OperatorSpecSpec.vip:type_name -> talos.resource.definitions.network.VIPOperatorSpec - 64, // 87: talos.resource.definitions.network.OperatorSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 0, // 88: talos.resource.definitions.network.PlatformConfigSpec.addresses:type_name -> talos.resource.definitions.network.AddressSpecSpec - 24, // 89: talos.resource.definitions.network.PlatformConfigSpec.links:type_name -> talos.resource.definitions.network.LinkSpecSpec - 47, // 90: talos.resource.definitions.network.PlatformConfigSpec.routes:type_name -> talos.resource.definitions.network.RouteSpecSpec - 20, // 91: talos.resource.definitions.network.PlatformConfigSpec.hostnames:type_name -> talos.resource.definitions.network.HostnameSpecSpec - 45, // 92: talos.resource.definitions.network.PlatformConfigSpec.resolvers:type_name -> talos.resource.definitions.network.ResolverSpecSpec - 52, // 93: talos.resource.definitions.network.PlatformConfigSpec.time_servers:type_name -> talos.resource.definitions.network.TimeServerSpecSpec - 40, // 94: talos.resource.definitions.network.PlatformConfigSpec.operators:type_name -> talos.resource.definitions.network.OperatorSpecSpec - 65, // 95: talos.resource.definitions.network.PlatformConfigSpec.external_ips:type_name -> common.NetIP - 43, // 96: talos.resource.definitions.network.PlatformConfigSpec.probes:type_name -> talos.resource.definitions.network.ProbeSpecSpec - 90, // 97: talos.resource.definitions.network.PlatformConfigSpec.metadata:type_name -> talos.resource.definitions.runtime.PlatformMetadataSpec - 91, // 98: talos.resource.definitions.network.ProbeSpecSpec.interval:type_name -> google.protobuf.Duration - 51, // 99: talos.resource.definitions.network.ProbeSpecSpec.tcp:type_name -> talos.resource.definitions.network.TCPProbeSpec - 64, // 100: talos.resource.definitions.network.ProbeSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 65, // 101: talos.resource.definitions.network.ResolverSpecSpec.dns_servers:type_name -> common.NetIP - 64, // 102: talos.resource.definitions.network.ResolverSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 65, // 103: talos.resource.definitions.network.ResolverStatusSpec.dns_servers:type_name -> common.NetIP - 62, // 104: talos.resource.definitions.network.RouteSpecSpec.family:type_name -> talos.resource.definitions.enums.NethelpersFamily - 61, // 105: talos.resource.definitions.network.RouteSpecSpec.destination:type_name -> common.NetIPPrefix - 65, // 106: talos.resource.definitions.network.RouteSpecSpec.source:type_name -> common.NetIP - 65, // 107: talos.resource.definitions.network.RouteSpecSpec.gateway:type_name -> common.NetIP - 92, // 108: talos.resource.definitions.network.RouteSpecSpec.table:type_name -> talos.resource.definitions.enums.NethelpersRoutingTable - 63, // 109: talos.resource.definitions.network.RouteSpecSpec.scope:type_name -> talos.resource.definitions.enums.NethelpersScope - 93, // 110: talos.resource.definitions.network.RouteSpecSpec.type:type_name -> talos.resource.definitions.enums.NethelpersRouteType - 94, // 111: talos.resource.definitions.network.RouteSpecSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersRouteProtocol - 64, // 112: talos.resource.definitions.network.RouteSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 62, // 113: talos.resource.definitions.network.RouteStatusSpec.family:type_name -> talos.resource.definitions.enums.NethelpersFamily - 61, // 114: talos.resource.definitions.network.RouteStatusSpec.destination:type_name -> common.NetIPPrefix - 65, // 115: talos.resource.definitions.network.RouteStatusSpec.source:type_name -> common.NetIP - 65, // 116: talos.resource.definitions.network.RouteStatusSpec.gateway:type_name -> common.NetIP - 92, // 117: talos.resource.definitions.network.RouteStatusSpec.table:type_name -> talos.resource.definitions.enums.NethelpersRoutingTable - 63, // 118: talos.resource.definitions.network.RouteStatusSpec.scope:type_name -> talos.resource.definitions.enums.NethelpersScope - 93, // 119: talos.resource.definitions.network.RouteStatusSpec.type:type_name -> talos.resource.definitions.enums.NethelpersRouteType - 94, // 120: talos.resource.definitions.network.RouteStatusSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersRouteProtocol - 91, // 121: talos.resource.definitions.network.TCPProbeSpec.timeout:type_name -> google.protobuf.Duration - 64, // 122: talos.resource.definitions.network.TimeServerSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer - 65, // 123: talos.resource.definitions.network.VIPOperatorSpec.ip:type_name -> common.NetIP - 54, // 124: talos.resource.definitions.network.VIPOperatorSpec.equinix_metal:type_name -> talos.resource.definitions.network.VIPEquinixMetalSpec - 55, // 125: talos.resource.definitions.network.VIPOperatorSpec.h_cloud:type_name -> talos.resource.definitions.network.VIPHCloudSpec - 95, // 126: talos.resource.definitions.network.VLANSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersVLANProtocol - 91, // 127: talos.resource.definitions.network.WireguardPeer.persistent_keepalive_interval:type_name -> google.protobuf.Duration - 61, // 128: talos.resource.definitions.network.WireguardPeer.allowed_ips:type_name -> common.NetIPPrefix - 58, // 129: talos.resource.definitions.network.WireguardSpec.peers:type_name -> talos.resource.definitions.network.WireguardPeer - 130, // [130:130] is the sub-list for method output_type - 130, // [130:130] is the sub-list for method input_type - 130, // [130:130] is the sub-list for extension type_name - 130, // [130:130] is the sub-list for extension extendee - 0, // [0:130] is the sub-list for field type_name + 65, // 19: talos.resource.definitions.network.BondMasterSpec.arpip_targets:type_name -> common.NetIP + 65, // 20: talos.resource.definitions.network.BondMasterSpec.nsip6_targets:type_name -> common.NetIP + 74, // 21: talos.resource.definitions.network.BondMasterSpec.adlacp_active:type_name -> talos.resource.definitions.enums.NethelpersADLACPActive + 49, // 22: talos.resource.definitions.network.BridgeMasterSpec.stp:type_name -> talos.resource.definitions.network.STPSpec + 6, // 23: talos.resource.definitions.network.BridgeMasterSpec.vlan:type_name -> talos.resource.definitions.network.BridgeVLANSpec + 75, // 24: talos.resource.definitions.network.ClientIdentifierSpec.client_identifier:type_name -> talos.resource.definitions.enums.NethelpersClientIdentifier + 7, // 25: talos.resource.definitions.network.DHCP4OperatorSpec.client_identifier:type_name -> talos.resource.definitions.network.ClientIdentifierSpec + 7, // 26: talos.resource.definitions.network.DHCP6OperatorSpec.client_identifier:type_name -> talos.resource.definitions.network.ClientIdentifierSpec + 14, // 27: talos.resource.definitions.network.EthernetSpecSpec.rings:type_name -> talos.resource.definitions.network.EthernetRingsSpec + 60, // 28: talos.resource.definitions.network.EthernetSpecSpec.features:type_name -> talos.resource.definitions.network.EthernetSpecSpec.FeaturesEntry + 11, // 29: talos.resource.definitions.network.EthernetSpecSpec.channels:type_name -> talos.resource.definitions.network.EthernetChannelsSpec + 76, // 30: talos.resource.definitions.network.EthernetSpecSpec.wake_on_lan:type_name -> talos.resource.definitions.enums.NethelpersWOLMode + 77, // 31: talos.resource.definitions.network.EthernetStatusSpec.port:type_name -> talos.resource.definitions.enums.NethelpersPort + 78, // 32: talos.resource.definitions.network.EthernetStatusSpec.duplex:type_name -> talos.resource.definitions.enums.NethelpersDuplex + 15, // 33: talos.resource.definitions.network.EthernetStatusSpec.rings:type_name -> talos.resource.definitions.network.EthernetRingsStatus + 13, // 34: talos.resource.definitions.network.EthernetStatusSpec.features:type_name -> talos.resource.definitions.network.EthernetFeatureStatus + 12, // 35: talos.resource.definitions.network.EthernetStatusSpec.channels:type_name -> talos.resource.definitions.network.EthernetChannelsStatus + 76, // 36: talos.resource.definitions.network.EthernetStatusSpec.wake_on_lan:type_name -> talos.resource.definitions.enums.NethelpersWOLMode + 79, // 37: talos.resource.definitions.network.HostDNSConfigSpec.listen_addresses:type_name -> common.NetIPPort + 65, // 38: talos.resource.definitions.network.HostDNSConfigSpec.service_host_dns_address:type_name -> common.NetIP + 64, // 39: talos.resource.definitions.network.HostnameSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 80, // 40: talos.resource.definitions.network.LinkSpecSpec.type:type_name -> talos.resource.definitions.enums.NethelpersLinkType + 3, // 41: talos.resource.definitions.network.LinkSpecSpec.bond_slave:type_name -> talos.resource.definitions.network.BondSlave + 5, // 42: talos.resource.definitions.network.LinkSpecSpec.bridge_slave:type_name -> talos.resource.definitions.network.BridgeSlave + 57, // 43: talos.resource.definitions.network.LinkSpecSpec.vlan:type_name -> talos.resource.definitions.network.VLANSpec + 2, // 44: talos.resource.definitions.network.LinkSpecSpec.bond_master:type_name -> talos.resource.definitions.network.BondMasterSpec + 4, // 45: talos.resource.definitions.network.LinkSpecSpec.bridge_master:type_name -> talos.resource.definitions.network.BridgeMasterSpec + 59, // 46: talos.resource.definitions.network.LinkSpecSpec.wireguard:type_name -> talos.resource.definitions.network.WireguardSpec + 64, // 47: talos.resource.definitions.network.LinkSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 80, // 48: talos.resource.definitions.network.LinkStatusSpec.type:type_name -> talos.resource.definitions.enums.NethelpersLinkType + 81, // 49: talos.resource.definitions.network.LinkStatusSpec.operational_state:type_name -> talos.resource.definitions.enums.NethelpersOperationalState + 77, // 50: talos.resource.definitions.network.LinkStatusSpec.port:type_name -> talos.resource.definitions.enums.NethelpersPort + 78, // 51: talos.resource.definitions.network.LinkStatusSpec.duplex:type_name -> talos.resource.definitions.enums.NethelpersDuplex + 57, // 52: talos.resource.definitions.network.LinkStatusSpec.vlan:type_name -> talos.resource.definitions.network.VLANSpec + 4, // 53: talos.resource.definitions.network.LinkStatusSpec.bridge_master:type_name -> talos.resource.definitions.network.BridgeMasterSpec + 2, // 54: talos.resource.definitions.network.LinkStatusSpec.bond_master:type_name -> talos.resource.definitions.network.BondMasterSpec + 59, // 55: talos.resource.definitions.network.LinkStatusSpec.wireguard:type_name -> talos.resource.definitions.network.WireguardSpec + 61, // 56: talos.resource.definitions.network.NfTablesAddressMatch.include_subnets:type_name -> common.NetIPPrefix + 61, // 57: talos.resource.definitions.network.NfTablesAddressMatch.exclude_subnets:type_name -> common.NetIPPrefix + 82, // 58: talos.resource.definitions.network.NfTablesChainSpec.hook:type_name -> talos.resource.definitions.enums.NethelpersNfTablesChainHook + 83, // 59: talos.resource.definitions.network.NfTablesChainSpec.priority:type_name -> talos.resource.definitions.enums.NethelpersNfTablesChainPriority + 36, // 60: talos.resource.definitions.network.NfTablesChainSpec.rules:type_name -> talos.resource.definitions.network.NfTablesRule + 84, // 61: talos.resource.definitions.network.NfTablesChainSpec.policy:type_name -> talos.resource.definitions.enums.NethelpersNfTablesVerdict + 85, // 62: talos.resource.definitions.network.NfTablesConntrackStateMatch.states:type_name -> talos.resource.definitions.enums.NethelpersConntrackState + 86, // 63: talos.resource.definitions.network.NfTablesICMPTypeMatch.types:type_name -> talos.resource.definitions.enums.NethelpersICMPType + 87, // 64: talos.resource.definitions.network.NfTablesIfNameMatch.operator:type_name -> talos.resource.definitions.enums.NethelpersMatchOperator + 88, // 65: talos.resource.definitions.network.NfTablesLayer4Match.protocol:type_name -> talos.resource.definitions.enums.NethelpersProtocol + 35, // 66: talos.resource.definitions.network.NfTablesLayer4Match.match_source_port:type_name -> talos.resource.definitions.network.NfTablesPortMatch + 35, // 67: talos.resource.definitions.network.NfTablesLayer4Match.match_destination_port:type_name -> talos.resource.definitions.network.NfTablesPortMatch + 30, // 68: talos.resource.definitions.network.NfTablesLayer4Match.match_icmp_type:type_name -> talos.resource.definitions.network.NfTablesICMPTypeMatch + 42, // 69: talos.resource.definitions.network.NfTablesPortMatch.ranges:type_name -> talos.resource.definitions.network.PortRange + 31, // 70: talos.resource.definitions.network.NfTablesRule.match_o_if_name:type_name -> talos.resource.definitions.network.NfTablesIfNameMatch + 84, // 71: talos.resource.definitions.network.NfTablesRule.verdict:type_name -> talos.resource.definitions.enums.NethelpersNfTablesVerdict + 34, // 72: talos.resource.definitions.network.NfTablesRule.match_mark:type_name -> talos.resource.definitions.network.NfTablesMark + 34, // 73: talos.resource.definitions.network.NfTablesRule.set_mark:type_name -> talos.resource.definitions.network.NfTablesMark + 26, // 74: talos.resource.definitions.network.NfTablesRule.match_source_address:type_name -> talos.resource.definitions.network.NfTablesAddressMatch + 26, // 75: talos.resource.definitions.network.NfTablesRule.match_destination_address:type_name -> talos.resource.definitions.network.NfTablesAddressMatch + 32, // 76: talos.resource.definitions.network.NfTablesRule.match_layer4:type_name -> talos.resource.definitions.network.NfTablesLayer4Match + 31, // 77: talos.resource.definitions.network.NfTablesRule.match_i_if_name:type_name -> talos.resource.definitions.network.NfTablesIfNameMatch + 28, // 78: talos.resource.definitions.network.NfTablesRule.clamp_mss:type_name -> talos.resource.definitions.network.NfTablesClampMSS + 33, // 79: talos.resource.definitions.network.NfTablesRule.match_limit:type_name -> talos.resource.definitions.network.NfTablesLimitMatch + 29, // 80: talos.resource.definitions.network.NfTablesRule.match_conntrack_state:type_name -> talos.resource.definitions.network.NfTablesConntrackStateMatch + 61, // 81: talos.resource.definitions.network.NodeAddressFilterSpec.include_subnets:type_name -> common.NetIPPrefix + 61, // 82: talos.resource.definitions.network.NodeAddressFilterSpec.exclude_subnets:type_name -> common.NetIPPrefix + 89, // 83: talos.resource.definitions.network.NodeAddressSortAlgorithmSpec.algorithm:type_name -> talos.resource.definitions.enums.NethelpersAddressSortAlgorithm + 61, // 84: talos.resource.definitions.network.NodeAddressSpec.addresses:type_name -> common.NetIPPrefix + 89, // 85: talos.resource.definitions.network.NodeAddressSpec.sort_algorithm:type_name -> talos.resource.definitions.enums.NethelpersAddressSortAlgorithm + 90, // 86: talos.resource.definitions.network.OperatorSpecSpec.operator:type_name -> talos.resource.definitions.enums.NetworkOperator + 8, // 87: talos.resource.definitions.network.OperatorSpecSpec.dhcp4:type_name -> talos.resource.definitions.network.DHCP4OperatorSpec + 9, // 88: talos.resource.definitions.network.OperatorSpecSpec.dhcp6:type_name -> talos.resource.definitions.network.DHCP6OperatorSpec + 56, // 89: talos.resource.definitions.network.OperatorSpecSpec.vip:type_name -> talos.resource.definitions.network.VIPOperatorSpec + 64, // 90: talos.resource.definitions.network.OperatorSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 0, // 91: talos.resource.definitions.network.PlatformConfigSpec.addresses:type_name -> talos.resource.definitions.network.AddressSpecSpec + 24, // 92: talos.resource.definitions.network.PlatformConfigSpec.links:type_name -> talos.resource.definitions.network.LinkSpecSpec + 47, // 93: talos.resource.definitions.network.PlatformConfigSpec.routes:type_name -> talos.resource.definitions.network.RouteSpecSpec + 20, // 94: talos.resource.definitions.network.PlatformConfigSpec.hostnames:type_name -> talos.resource.definitions.network.HostnameSpecSpec + 45, // 95: talos.resource.definitions.network.PlatformConfigSpec.resolvers:type_name -> talos.resource.definitions.network.ResolverSpecSpec + 52, // 96: talos.resource.definitions.network.PlatformConfigSpec.time_servers:type_name -> talos.resource.definitions.network.TimeServerSpecSpec + 40, // 97: talos.resource.definitions.network.PlatformConfigSpec.operators:type_name -> talos.resource.definitions.network.OperatorSpecSpec + 65, // 98: talos.resource.definitions.network.PlatformConfigSpec.external_ips:type_name -> common.NetIP + 43, // 99: talos.resource.definitions.network.PlatformConfigSpec.probes:type_name -> talos.resource.definitions.network.ProbeSpecSpec + 91, // 100: talos.resource.definitions.network.PlatformConfigSpec.metadata:type_name -> talos.resource.definitions.runtime.PlatformMetadataSpec + 92, // 101: talos.resource.definitions.network.ProbeSpecSpec.interval:type_name -> google.protobuf.Duration + 51, // 102: talos.resource.definitions.network.ProbeSpecSpec.tcp:type_name -> talos.resource.definitions.network.TCPProbeSpec + 64, // 103: talos.resource.definitions.network.ProbeSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 65, // 104: talos.resource.definitions.network.ResolverSpecSpec.dns_servers:type_name -> common.NetIP + 64, // 105: talos.resource.definitions.network.ResolverSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 65, // 106: talos.resource.definitions.network.ResolverStatusSpec.dns_servers:type_name -> common.NetIP + 62, // 107: talos.resource.definitions.network.RouteSpecSpec.family:type_name -> talos.resource.definitions.enums.NethelpersFamily + 61, // 108: talos.resource.definitions.network.RouteSpecSpec.destination:type_name -> common.NetIPPrefix + 65, // 109: talos.resource.definitions.network.RouteSpecSpec.source:type_name -> common.NetIP + 65, // 110: talos.resource.definitions.network.RouteSpecSpec.gateway:type_name -> common.NetIP + 93, // 111: talos.resource.definitions.network.RouteSpecSpec.table:type_name -> talos.resource.definitions.enums.NethelpersRoutingTable + 63, // 112: talos.resource.definitions.network.RouteSpecSpec.scope:type_name -> talos.resource.definitions.enums.NethelpersScope + 94, // 113: talos.resource.definitions.network.RouteSpecSpec.type:type_name -> talos.resource.definitions.enums.NethelpersRouteType + 95, // 114: talos.resource.definitions.network.RouteSpecSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersRouteProtocol + 64, // 115: talos.resource.definitions.network.RouteSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 62, // 116: talos.resource.definitions.network.RouteStatusSpec.family:type_name -> talos.resource.definitions.enums.NethelpersFamily + 61, // 117: talos.resource.definitions.network.RouteStatusSpec.destination:type_name -> common.NetIPPrefix + 65, // 118: talos.resource.definitions.network.RouteStatusSpec.source:type_name -> common.NetIP + 65, // 119: talos.resource.definitions.network.RouteStatusSpec.gateway:type_name -> common.NetIP + 93, // 120: talos.resource.definitions.network.RouteStatusSpec.table:type_name -> talos.resource.definitions.enums.NethelpersRoutingTable + 63, // 121: talos.resource.definitions.network.RouteStatusSpec.scope:type_name -> talos.resource.definitions.enums.NethelpersScope + 94, // 122: talos.resource.definitions.network.RouteStatusSpec.type:type_name -> talos.resource.definitions.enums.NethelpersRouteType + 95, // 123: talos.resource.definitions.network.RouteStatusSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersRouteProtocol + 92, // 124: talos.resource.definitions.network.TCPProbeSpec.timeout:type_name -> google.protobuf.Duration + 64, // 125: talos.resource.definitions.network.TimeServerSpecSpec.config_layer:type_name -> talos.resource.definitions.enums.NetworkConfigLayer + 65, // 126: talos.resource.definitions.network.VIPOperatorSpec.ip:type_name -> common.NetIP + 54, // 127: talos.resource.definitions.network.VIPOperatorSpec.equinix_metal:type_name -> talos.resource.definitions.network.VIPEquinixMetalSpec + 55, // 128: talos.resource.definitions.network.VIPOperatorSpec.h_cloud:type_name -> talos.resource.definitions.network.VIPHCloudSpec + 96, // 129: talos.resource.definitions.network.VLANSpec.protocol:type_name -> talos.resource.definitions.enums.NethelpersVLANProtocol + 92, // 130: talos.resource.definitions.network.WireguardPeer.persistent_keepalive_interval:type_name -> google.protobuf.Duration + 61, // 131: talos.resource.definitions.network.WireguardPeer.allowed_ips:type_name -> common.NetIPPrefix + 58, // 132: talos.resource.definitions.network.WireguardSpec.peers:type_name -> talos.resource.definitions.network.WireguardPeer + 133, // [133:133] is the sub-list for method output_type + 133, // [133:133] is the sub-list for method input_type + 133, // [133:133] is the sub-list for extension type_name + 133, // [133:133] is the sub-list for extension extendee + 0, // [0:133] is the sub-list for field type_name } func init() { file_resource_definitions_network_network_proto_init() } diff --git a/pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go b/pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go index 1ad52de93..f55a46e8c 100644 --- a/pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go +++ b/pkg/machinery/api/resource/definitions/network/network_vtproto.pb.go @@ -328,6 +328,72 @@ func (m *BondMasterSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.MissedMax != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MissedMax)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe0 + } + if m.AdlacpActive != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.AdlacpActive)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd8 + } + if len(m.Nsip6Targets) > 0 { + for iNdEx := len(m.Nsip6Targets) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Nsip6Targets[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Nsip6Targets[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.ArpipTargets) > 0 { + for iNdEx := len(m.ArpipTargets) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.ArpipTargets[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ArpipTargets[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + } if m.PeerNotifyDelay != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PeerNotifyDelay)) i-- @@ -4824,6 +4890,36 @@ func (m *BondMasterSpec) SizeVT() (n int) { if m.PeerNotifyDelay != 0 { n += 2 + protohelpers.SizeOfVarint(uint64(m.PeerNotifyDelay)) } + if len(m.ArpipTargets) > 0 { + for _, e := range m.ArpipTargets { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Nsip6Targets) > 0 { + for _, e := range m.Nsip6Targets { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.AdlacpActive != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.AdlacpActive)) + } + if m.MissedMax != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.MissedMax)) + } n += len(m.unknownFields) return n } @@ -7611,6 +7707,128 @@ func (m *BondMasterSpec) UnmarshalVT(dAtA []byte) error { break } } + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArpipTargets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ArpipTargets = append(m.ArpipTargets, &common.NetIP{}) + if unmarshal, ok := interface{}(m.ArpipTargets[len(m.ArpipTargets)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.ArpipTargets[len(m.ArpipTargets)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nsip6Targets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nsip6Targets = append(m.Nsip6Targets, &common.NetIP{}) + if unmarshal, ok := interface{}(m.Nsip6Targets[len(m.Nsip6Targets)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Nsip6Targets[len(m.Nsip6Targets)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AdlacpActive", wireType) + } + m.AdlacpActive = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AdlacpActive |= enums.NethelpersADLACPActive(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MissedMax", wireType) + } + m.MissedMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MissedMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/pkg/machinery/config/config/network.go b/pkg/machinery/config/config/network.go index a47d1c4b2..0299fb305 100644 --- a/pkg/machinery/config/config/network.go +++ b/pkg/machinery/config/config/network.go @@ -219,3 +219,41 @@ type NetworkVLANConfig interface { ParentLink() string VLANMode() optional.Optional[nethelpers.VLANProtocol] } + +// NetworkBondConfig defines a bond link configuration. +// +//nolint:interfacebloat +type NetworkBondConfig interface { + NamedDocument + NetworkCommonLinkConfig + NetworkHardwareAddressConfig + BondConfig() + Links() []string + Mode() nethelpers.BondMode + MIIMon() optional.Optional[uint32] + UpDelay() optional.Optional[uint32] + DownDelay() optional.Optional[uint32] + UseCarrier() optional.Optional[bool] + XmitHashPolicy() optional.Optional[nethelpers.BondXmitHashPolicy] + ARPInterval() optional.Optional[uint32] + ARPIPTargets() []netip.Addr + NSIP6Targets() []netip.Addr + ARPValidate() optional.Optional[nethelpers.ARPValidate] + ARPAllTargets() optional.Optional[nethelpers.ARPAllTargets] + LACPRate() optional.Optional[nethelpers.LACPRate] + FailOverMAC() optional.Optional[nethelpers.FailOverMAC] + ADSelect() optional.Optional[nethelpers.ADSelect] + ADActorSysPrio() optional.Optional[uint16] + ADUserPortKey() optional.Optional[uint16] + ADLACPActive() optional.Optional[nethelpers.ADLACPActive] + PrimaryReselect() optional.Optional[nethelpers.PrimaryReselect] + ResendIGMP() optional.Optional[uint32] + MinLinks() optional.Optional[uint32] + LPInterval() optional.Optional[uint32] + PacketsPerSlave() optional.Optional[uint32] + NumPeerNotif() optional.Optional[uint8] + TLBDynamicLB() optional.Optional[uint8] + AllSlavesActive() optional.Optional[uint8] + PeerNotifyDelay() optional.Optional[uint32] + MissedMax() optional.Optional[uint8] +} diff --git a/pkg/machinery/config/schemas/config.schema.json b/pkg/machinery/config/schemas/config.schema.json index 6527bd32d..3d94f34e9 100644 --- a/pkg/machinery/config/schemas/config.schema.json +++ b/pkg/machinery/config/schemas/config.schema.json @@ -758,6 +758,337 @@ ], "description": "AddressConfig represents a network address configuration." }, + "network.BondConfigV1Alpha1": { + "properties": { + "apiVersion": { + "enum": [ + "v1alpha1" + ], + "title": "apiVersion", + "description": "apiVersion is the API version of the resource.\n", + "markdownDescription": "apiVersion is the API version of the resource.", + "x-intellij-html-description": "\u003cp\u003eapiVersion is the API version of the resource.\u003c/p\u003e\n" + }, + "kind": { + "enum": [ + "BondConfig" + ], + "title": "kind", + "description": "kind is the kind of the resource.\n", + "markdownDescription": "kind is the kind of the resource.", + "x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n" + }, + "name": { + "type": "string", + "title": "name", + "description": "Name of the bond link (interface) to be created.\n", + "markdownDescription": "Name of the bond link (interface) to be created.", + "x-intellij-html-description": "\u003cp\u003eName of the bond link (interface) to be created.\u003c/p\u003e\n" + }, + "hardwareAddr": { + "type": "string", + "pattern": "^[0-9a-f:]+$", + "title": "hardwareAddr", + "description": "Override the hardware (MAC) address of the link.\n", + "markdownDescription": "Override the hardware (MAC) address of the link.", + "x-intellij-html-description": "\u003cp\u003eOverride the hardware (MAC) address of the link.\u003c/p\u003e\n" + }, + "links": { + "items": { + "type": "string" + }, + "type": "array", + "title": "links", + "description": "Names of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.\n", + "markdownDescription": "Names of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.", + "x-intellij-html-description": "\u003cp\u003eNames of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.\u003c/p\u003e\n" + }, + "bondMode": { + "enum": [ + "balance-rr", + "active-backup", + "balance-xor", + "broadcast", + "802.3ad", + "balance-tlb", + "balance-alb" + ], + "title": "bondMode", + "description": "Bond mode.\n", + "markdownDescription": "Bond mode.", + "x-intellij-html-description": "\u003cp\u003eBond mode.\u003c/p\u003e\n" + }, + "miimon": { + "type": "integer", + "title": "miimon", + "description": "Link monitoring frequency in milliseconds.\n", + "markdownDescription": "Link monitoring frequency in milliseconds.", + "x-intellij-html-description": "\u003cp\u003eLink monitoring frequency in milliseconds.\u003c/p\u003e\n" + }, + "updelay": { + "type": "integer", + "title": "updelay", + "description": "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.\n", + "markdownDescription": "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.", + "x-intellij-html-description": "\u003cp\u003eThe time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.\u003c/p\u003e\n" + }, + "downdelay": { + "type": "integer", + "title": "downdelay", + "description": "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.\n", + "markdownDescription": "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.", + "x-intellij-html-description": "\u003cp\u003eThe time, in milliseconds, to wait before disabling a slave after a link failure has been detected.\u003c/p\u003e\n" + }, + "useCarrier": { + "type": "boolean", + "title": "useCarrier", + "description": "Specifies whether or not miimon should use MII or ETHTOOL.\n", + "markdownDescription": "Specifies whether or not miimon should use MII or ETHTOOL.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether or not miimon should use MII or ETHTOOL.\u003c/p\u003e\n" + }, + "xmitHashPolicy": { + "enum": [ + "layer2", + "layer3+4", + "layer2+3", + "encap2+3", + "encap3+4" + ], + "title": "xmitHashPolicy", + "description": "Selects the transmit hash policy to use for slave selection.\n", + "markdownDescription": "Selects the transmit hash policy to use for slave selection.", + "x-intellij-html-description": "\u003cp\u003eSelects the transmit hash policy to use for slave selection.\u003c/p\u003e\n" + }, + "arpInterval": { + "type": "integer", + "title": "arpInterval", + "description": "ARP link monitoring frequency in milliseconds.\n", + "markdownDescription": "ARP link monitoring frequency in milliseconds.", + "x-intellij-html-description": "\u003cp\u003eARP link monitoring frequency in milliseconds.\u003c/p\u003e\n" + }, + "arpIpTargets": { + "items": { + "type": "string", + "pattern": "^[0-9a-f.:]+$" + }, + "type": "array", + "title": "arpIpTargets", + "description": "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\n", + "markdownDescription": "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + "x-intellij-html-description": "\u003cp\u003eThe list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\u003c/p\u003e\n" + }, + "nsIp6Targets": { + "items": { + "type": "string", + "pattern": "^[0-9a-f.:]+$" + }, + "type": "array", + "title": "nsIp6Targets", + "description": "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\n", + "markdownDescription": "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + "x-intellij-html-description": "\u003cp\u003eThe list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\u003c/p\u003e\n" + }, + "arpValidate": { + "enum": [ + "none", + "active", + "backup", + "all", + "filter", + "filter-active", + "filter-backup" + ], + "title": "arpValidate", + "description": "Specifies whether or not ARP probes and replies should be validated.\n", + "markdownDescription": "Specifies whether or not ARP probes and replies should be validated.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether or not ARP probes and replies should be validated.\u003c/p\u003e\n" + }, + "arpAllTargets": { + "enum": [ + "any", + "all" + ], + "title": "arpAllTargets", + "description": "Specifies whether ARP probes should be sent to any or all targets.\n", + "markdownDescription": "Specifies whether ARP probes should be sent to any or all targets.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether ARP probes should be sent to any or all targets.\u003c/p\u003e\n" + }, + "lacpRate": { + "enum": [ + "slow", + "fast" + ], + "title": "lacpRate", + "description": "LACPDU frames periodic transmission rate.\n", + "markdownDescription": "LACPDU frames periodic transmission rate.", + "x-intellij-html-description": "\u003cp\u003eLACPDU frames periodic transmission rate.\u003c/p\u003e\n" + }, + "failOverMac": { + "enum": [ + "none", + "active", + "follow" + ], + "title": "failOverMac", + "description": "Specifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.\n", + "markdownDescription": "Specifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.\u003c/p\u003e\n" + }, + "adSelect": { + "enum": [ + "stable", + "bandwidth", + "count" + ], + "title": "adSelect", + "description": "Aggregate selection policy for 802.3ad.\n", + "markdownDescription": "Aggregate selection policy for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eAggregate selection policy for 802.3ad.\u003c/p\u003e\n" + }, + "adActorSysPrio": { + "type": "integer", + "title": "adActorSysPrio", + "description": "Actor system priority for 802.3ad.\n", + "markdownDescription": "Actor system priority for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eActor system priority for 802.3ad.\u003c/p\u003e\n" + }, + "adUserPortKey": { + "type": "integer", + "title": "adUserPortKey", + "description": "User port key (upper 10 bits) for 802.3ad.\n", + "markdownDescription": "User port key (upper 10 bits) for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eUser port key (upper 10 bits) for 802.3ad.\u003c/p\u003e\n" + }, + "adLACPActive": { + "enum": [ + "on", + "off" + ], + "title": "adLACPActive", + "description": "Whether to send LACPDU frames periodically.\n", + "markdownDescription": "Whether to send LACPDU frames periodically.", + "x-intellij-html-description": "\u003cp\u003eWhether to send LACPDU frames periodically.\u003c/p\u003e\n" + }, + "primaryReselect": { + "enum": [ + "always", + "better", + "failure" + ], + "title": "primaryReselect", + "description": "Policy under which the primary slave should be reselected.\n", + "markdownDescription": "Policy under which the primary slave should be reselected.", + "x-intellij-html-description": "\u003cp\u003ePolicy under which the primary slave should be reselected.\u003c/p\u003e\n" + }, + "resendIGMP": { + "type": "integer", + "title": "resendIGMP", + "description": "The number of times IGMP packets should be resent.\n", + "markdownDescription": "The number of times IGMP packets should be resent.", + "x-intellij-html-description": "\u003cp\u003eThe number of times IGMP packets should be resent.\u003c/p\u003e\n" + }, + "minLinks": { + "type": "integer", + "title": "minLinks", + "description": "The minimum number of active links required for the bond to be considered active.\n", + "markdownDescription": "The minimum number of active links required for the bond to be considered active.", + "x-intellij-html-description": "\u003cp\u003eThe minimum number of active links required for the bond to be considered active.\u003c/p\u003e\n" + }, + "lpInterval": { + "type": "integer", + "title": "lpInterval", + "description": "The number of seconds between instances where the bonding driver sends learning packets to each slave’s peer switch.\n", + "markdownDescription": "The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch.", + "x-intellij-html-description": "\u003cp\u003eThe number of seconds between instances where the bonding driver sends learning packets to each slave\u0026rsquo;s peer switch.\u003c/p\u003e\n" + }, + "packetsPerSlave": { + "type": "integer", + "title": "packetsPerSlave", + "description": "The number of packets to transmit through a slave before moving to the next one.\n", + "markdownDescription": "The number of packets to transmit through a slave before moving to the next one.", + "x-intellij-html-description": "\u003cp\u003eThe number of packets to transmit through a slave before moving to the next one.\u003c/p\u003e\n" + }, + "numPeerNotif": { + "type": "integer", + "title": "numPeerNotif", + "description": "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.\n", + "markdownDescription": "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.", + "x-intellij-html-description": "\u003cp\u003eThe number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.\u003c/p\u003e\n" + }, + "tlbLogicalLb": { + "type": "integer", + "title": "tlbLogicalLb", + "description": "Whether dynamic shuffling of flows is enabled in tlb or alb mode.\n", + "markdownDescription": "Whether dynamic shuffling of flows is enabled in tlb or alb mode.", + "x-intellij-html-description": "\u003cp\u003eWhether dynamic shuffling of flows is enabled in tlb or alb mode.\u003c/p\u003e\n" + }, + "allSlavesActive": { + "type": "integer", + "title": "allSlavesActive", + "description": "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).\n", + "markdownDescription": "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).", + "x-intellij-html-description": "\u003cp\u003eWhether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).\u003c/p\u003e\n" + }, + "peerNotifDelay": { + "type": "integer", + "title": "peerNotifDelay", + "description": "The delay, in milliseconds, between each peer notification.\n", + "markdownDescription": "The delay, in milliseconds, between each peer notification.", + "x-intellij-html-description": "\u003cp\u003eThe delay, in milliseconds, between each peer notification.\u003c/p\u003e\n" + }, + "missedMax": { + "type": "integer", + "title": "missedMax", + "description": "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.\n", + "markdownDescription": "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.", + "x-intellij-html-description": "\u003cp\u003eThe number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.\u003c/p\u003e\n" + }, + "up": { + "type": "boolean", + "title": "up", + "description": "Bring the link up or down.\n\nIf not specified, the link will be brought up.\n", + "markdownDescription": "Bring the link up or down.\n\nIf not specified, the link will be brought up.", + "x-intellij-html-description": "\u003cp\u003eBring the link up or down.\u003c/p\u003e\n\n\u003cp\u003eIf not specified, the link will be brought up.\u003c/p\u003e\n" + }, + "mtu": { + "type": "integer", + "title": "mtu", + "description": "Configure LinkMTU (Maximum Transmission Unit) for the link.\n\nIf not specified, the system default LinkMTU will be used (usually 1500).\n", + "markdownDescription": "Configure LinkMTU (Maximum Transmission Unit) for the link.\n\nIf not specified, the system default LinkMTU will be used (usually 1500).", + "x-intellij-html-description": "\u003cp\u003eConfigure LinkMTU (Maximum Transmission Unit) for the link.\u003c/p\u003e\n\n\u003cp\u003eIf not specified, the system default LinkMTU will be used (usually 1500).\u003c/p\u003e\n" + }, + "addresses": { + "items": { + "$ref": "#/$defs/network.AddressConfig" + }, + "type": "array", + "title": "addresses", + "description": "Configure addresses to be statically assigned to the link.\n", + "markdownDescription": "Configure addresses to be statically assigned to the link.", + "x-intellij-html-description": "\u003cp\u003eConfigure addresses to be statically assigned to the link.\u003c/p\u003e\n" + }, + "routes": { + "items": { + "$ref": "#/$defs/network.RouteConfig" + }, + "type": "array", + "title": "routes", + "description": "Configure routes to be statically created via the link.\n", + "markdownDescription": "Configure routes to be statically created via the link.", + "x-intellij-html-description": "\u003cp\u003eConfigure routes to be statically created via the link.\u003c/p\u003e\n" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "apiVersion", + "bondMode", + "kind", + "links", + "name" + ], + "description": "BondConfig is a config document to create a bond (link aggregation) over a set of links." + }, "network.CommonLinkConfig": { "properties": { "up": { @@ -1810,9 +2141,9 @@ "parent": { "type": "string", "title": "parent", - "description": "Name of the parent link (interface) on which the VLAN link will be created.\n", - "markdownDescription": "Name of the parent link (interface) on which the VLAN link will be created.", - "x-intellij-html-description": "\u003cp\u003eName of the parent link (interface) on which the VLAN link will be created.\u003c/p\u003e\n" + "description": "Name of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.\n", + "markdownDescription": "Name of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.", + "x-intellij-html-description": "\u003cp\u003eName of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.\u003c/p\u003e\n" }, "up": { "type": "boolean", @@ -5059,6 +5390,9 @@ { "$ref": "#/$defs/hardware.PCIDriverRebindConfigV1Alpha1" }, + { + "$ref": "#/$defs/network.BondConfigV1Alpha1" + }, { "$ref": "#/$defs/network.DefaultActionConfigV1Alpha1" }, diff --git a/pkg/machinery/config/types/network/bond.go b/pkg/machinery/config/types/network/bond.go new file mode 100644 index 000000000..901a0e38c --- /dev/null +++ b/pkg/machinery/config/types/network/bond.go @@ -0,0 +1,613 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package network + +//docgen:jsonschema + +import ( + "errors" + "net/netip" + + "github.com/siderolabs/gen/optional" + "github.com/siderolabs/go-pointer" + + "github.com/siderolabs/talos/pkg/machinery/config/config" + "github.com/siderolabs/talos/pkg/machinery/config/internal/registry" + "github.com/siderolabs/talos/pkg/machinery/config/types/meta" + "github.com/siderolabs/talos/pkg/machinery/config/validation" + "github.com/siderolabs/talos/pkg/machinery/nethelpers" +) + +// BondKind is a Bond config document kind. +const BondKind = "BondConfig" + +func init() { + registry.Register(BondKind, func(version string) config.Document { + switch version { + case "v1alpha1": //nolint:goconst + return &BondConfigV1Alpha1{} + default: + return nil + } + }) +} + +// Check interfaces. +var ( + _ config.NetworkBondConfig = &BondConfigV1Alpha1{} + _ config.ConflictingDocument = &BondConfigV1Alpha1{} + _ config.NamedDocument = &BondConfigV1Alpha1{} + _ config.Validator = &BondConfigV1Alpha1{} +) + +// BondConfigV1Alpha1 is a config document to create a bond (link aggregation) over a set of links. +// +// examples: +// - value: exampleBondConfigV1Alpha1() +// alias: BondConfig +// schemaRoot: true +// schemaMeta: v1alpha1/BondConfig +type BondConfigV1Alpha1 struct { + meta.Meta `yaml:",inline"` + + // description: | + // Name of the bond link (interface) to be created. + // + // examples: + // - value: > + // "bond.ext" + // schemaRequired: true + MetaName string `yaml:"name"` + // description: | + // Override the hardware (MAC) address of the link. + // + // examples: + // - value: > + // nethelpers.HardwareAddr{0x2e, 0x3c, 0x4d, 0x5e, 0x6f, 0x70} + // schema: + // type: string + // pattern: ^[0-9a-f:]+$ + HardwareAddressConfig nethelpers.HardwareAddr `yaml:"hardwareAddr,omitempty"` + // description: | + // Names of the links (interfaces) on which the bond will be created. + // Link aliases can be used here as well. + // examples: + // - value: > + // []string{"enp0s3", "enp0s8"} + // schemaRequired: true + BondLinks []string `yaml:"links,omitempty"` + // description: | + // Bond mode. + // + // examples: + // - value: > + // "802.3ad" + // values: + // - "balance-rr" + // - "active-backup" + // - "balance-xor" + // - "broadcast" + // - "802.3ad" + // - "balance-tlb" + // - "balance-alb" + // schemaRequired: true + BondMode *nethelpers.BondMode `yaml:"bondMode,omitempty"` + // description: | + // Link monitoring frequency in milliseconds. + // + // examples: + // - value: > + // 200 + BondMIIMon *uint32 `yaml:"miimon,omitempty"` + // description: | + // The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. + // + // examples: + // - value: > + // 300 + BondUpDelay *uint32 `yaml:"updelay,omitempty"` + // description: | + // The time, in milliseconds, to wait before disabling a slave after a link failure has been detected. + // + // examples: + // - value: > + // 100 + BondDownDelay *uint32 `yaml:"downdelay,omitempty"` + // description: | + // Specifies whether or not miimon should use MII or ETHTOOL. + BondUseCarrier *bool `yaml:"useCarrier,omitempty"` + // description: | + // Selects the transmit hash policy to use for slave selection. + // examples: + // - value: > + // "layer2" + // values: + // - "layer2" + // - "layer3+4" + // - "layer2+3" + // - "encap2+3" + // - "encap3+4" + BondXmitHashPolicy *nethelpers.BondXmitHashPolicy `yaml:"xmitHashPolicy,omitempty"` + // description: | + // ARP link monitoring frequency in milliseconds. + // examples: + // - value: > + // 1000 + BondARPInterval *uint32 `yaml:"arpInterval,omitempty"` + // description: | + // The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set. + // Maximum of 16 targets are supported. + // examples: + // - value: > + // []netip.Addr{netip.MustParseAddr("10.15.0.1")} + // schema: + // type: array + // items: + // type: string + // pattern: ^[0-9a-f.:]+$ + BondARPIPTargets []netip.Addr `yaml:"arpIpTargets,omitempty"` + // description: | + // The list of IPv6 addresses to use for NS link monitoring when arpInterval is set. + // Maximum of 16 targets are supported. + // examples: + // - value: > + // []netip.Addr{netip.MustParseAddr("fd00::1")} + // schema: + // type: array + // items: + // type: string + // pattern: ^[0-9a-f.:]+$ + BondNSIP6Targets []netip.Addr `yaml:"nsIp6Targets,omitempty"` + // description: | + // Specifies whether or not ARP probes and replies should be validated. + // examples: + // - value: > + // "active" + // values: + // - "none" + // - "active" + // - "backup" + // - "all" + // - "filter" + // - "filter-active" + // - "filter-backup" + BondARPValidate *nethelpers.ARPValidate `yaml:"arpValidate,omitempty"` + // description: | + // Specifies whether ARP probes should be sent to any or all targets. + // examples: + // - value: > + // "all" + // values: + // - "any" + // - "all" + BondARPAllTargets *nethelpers.ARPAllTargets `yaml:"arpAllTargets,omitempty"` + // description: | + // LACPDU frames periodic transmission rate. + // examples: + // - value: > + // "fast" + // values: + // - "slow" + // - "fast" + BondLACPRate *nethelpers.LACPRate `yaml:"lacpRate,omitempty"` + // description: | + // Specifies whether active-backup mode should set all slaves to the same MAC address + // at enslavement, when enabled, or perform special handling. + // examples: + // - value: > + // "active" + // values: + // - "none" + // - "active" + // - "follow" + BondFailOverMAC *nethelpers.FailOverMAC `yaml:"failOverMac,omitempty"` + // description: | + // Aggregate selection policy for 802.3ad. + // examples: + // - value: > + // "stable" + // values: + // - "stable" + // - "bandwidth" + // - "count" + BondADSelect *nethelpers.ADSelect `yaml:"adSelect,omitempty"` + // description: | + // Actor system priority for 802.3ad. + // + // examples: + // - value: > + // 65535 + BondADActorSysPrio *uint16 `yaml:"adActorSysPrio,omitempty"` + // description: | + // User port key (upper 10 bits) for 802.3ad. + // + // examples: + // - value: > + // 0 + BondADUserPortKey *uint16 `yaml:"adUserPortKey,omitempty"` + // description: | + // Whether to send LACPDU frames periodically. + // examples: + // - value: > + // "on" + // values: + // - "on" + // - "off" + BondADLACPActive *nethelpers.ADLACPActive `yaml:"adLACPActive,omitempty"` + // description: | + // Policy under which the primary slave should be reselected. + // examples: + // - value: > + // "always" + // values: + // - "always" + // - "better" + // - "failure" + BondPrimaryReselect *nethelpers.PrimaryReselect `yaml:"primaryReselect,omitempty"` + // description: | + // The number of times IGMP packets should be resent. + BondResendIGMP *uint32 `yaml:"resendIGMP,omitempty"` + // description: | + // The minimum number of active links required for the bond to be considered active. + BondMinLinks *uint32 `yaml:"minLinks,omitempty"` + // description: | + // The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch. + BondLPInterval *uint32 `yaml:"lpInterval,omitempty"` + // description: | + // The number of packets to transmit through a slave before moving to the next one. + BondPacketsPerSlave *uint32 `yaml:"packetsPerSlave,omitempty"` + // description: | + // The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements) + // to be issued after a failover event. + BondNumPeerNotif *uint8 `yaml:"numPeerNotif,omitempty"` + // description: | + // Whether dynamic shuffling of flows is enabled in tlb or alb mode. + // examples: + // - value: > + // 1 + BondTLBDynamicLB *uint8 `yaml:"tlbLogicalLb,omitempty"` + // description: | + // Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1). + // examples: + // - value: > + // 0 + BondAllSlavesActive *uint8 `yaml:"allSlavesActive,omitempty"` + // description: | + // The delay, in milliseconds, between each peer notification. + BondPeerNotifyDelay *uint32 `yaml:"peerNotifDelay,omitempty"` + // description: | + // The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor. + BondMissedMax *uint8 `yaml:"missedMax,omitempty"` + + //nolint:embeddedstructfieldcheck + CommonLinkConfig `yaml:",inline"` +} + +// NewBondConfigV1Alpha1 creates a new BondConfig config document. +func NewBondConfigV1Alpha1(name string) *BondConfigV1Alpha1 { + return &BondConfigV1Alpha1{ + Meta: meta.Meta{ + MetaKind: BondKind, + MetaAPIVersion: "v1alpha1", + }, + MetaName: name, + } +} + +func exampleBondConfigV1Alpha1() *BondConfigV1Alpha1 { + cfg := NewBondConfigV1Alpha1("bond.int") + cfg.BondLinks = []string{"enp1s2", "enp1s2"} + cfg.BondMode = pointer.To(nethelpers.BondMode8023AD) + cfg.BondXmitHashPolicy = pointer.To(nethelpers.BondXmitPolicyLayer34) + cfg.BondLACPRate = pointer.To(nethelpers.LACPRateSlow) + cfg.BondMIIMon = pointer.To(uint32(100)) + cfg.BondUpDelay = pointer.To(uint32(200)) + cfg.BondDownDelay = pointer.To(uint32(200)) + cfg.BondResendIGMP = pointer.To(uint32(1)) + cfg.BondPacketsPerSlave = pointer.To(uint32(1)) + cfg.BondADActorSysPrio = pointer.To(uint16(65535)) + + cfg.LinkAddresses = []AddressConfig{ + { + AddressAddress: netip.MustParsePrefix("10.15.0.3/16"), + }, + } + cfg.LinkRoutes = []RouteConfig{ + { + RouteDestination: Prefix{netip.MustParsePrefix("10.0.0.0/8")}, + RouteGateway: Addr{netip.MustParseAddr("10.15.0.1")}, + }, + } + + return cfg +} + +// Clone implements config.Document interface. +func (s *BondConfigV1Alpha1) Clone() config.Document { + return s.DeepCopy() +} + +// Name implements config.NamedDocument interface. +func (s *BondConfigV1Alpha1) Name() string { + return s.MetaName +} + +// BondConfig implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) BondConfig() {} + +// ConflictsWithKinds implements config.ConflictingDocument interface. +func (s *BondConfigV1Alpha1) ConflictsWithKinds() []string { + return conflictingLinkKinds(BondKind) +} + +// Validate implements config.Validator interface. +func (s *BondConfigV1Alpha1) Validate(validation.RuntimeMode, ...validation.Option) ([]string, error) { + var ( + errs error + warnings []string + ) + + if s.MetaName == "" { + errs = errors.Join(errs, errors.New("name must be specified")) + } + + if len(s.BondLinks) == 0 { + errs = errors.Join(errs, errors.New("at least one link must be specified")) + } + + if s.BondMode == nil { + errs = errors.Join(errs, errors.New("bond mode must be specified")) + } + + extraWarnings, extraErrs := s.CommonLinkConfig.Validate() + errs, warnings = errors.Join(errs, extraErrs), append(warnings, extraWarnings...) + + return warnings, errs +} + +// Links implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) Links() []string { + return s.BondLinks +} + +// Mode implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) Mode() nethelpers.BondMode { + return pointer.SafeDeref(s.BondMode) +} + +// MIIMon implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) MIIMon() optional.Optional[uint32] { + if s.BondMIIMon == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondMIIMon) +} + +// UpDelay implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) UpDelay() optional.Optional[uint32] { + if s.BondUpDelay == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondUpDelay) +} + +// DownDelay implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) DownDelay() optional.Optional[uint32] { + if s.BondDownDelay == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondDownDelay) +} + +// UseCarrier implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) UseCarrier() optional.Optional[bool] { + if s.BondUseCarrier == nil { + return optional.None[bool]() + } + + return optional.Some(*s.BondUseCarrier) +} + +// XmitHashPolicy implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) XmitHashPolicy() optional.Optional[nethelpers.BondXmitHashPolicy] { + if s.BondXmitHashPolicy == nil { + return optional.None[nethelpers.BondXmitHashPolicy]() + } + + return optional.Some(*s.BondXmitHashPolicy) +} + +// ARPInterval implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ARPInterval() optional.Optional[uint32] { + if s.BondARPInterval == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondARPInterval) +} + +// ARPIPTargets implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ARPIPTargets() []netip.Addr { + return s.BondARPIPTargets +} + +// NSIP6Targets implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) NSIP6Targets() []netip.Addr { + return s.BondNSIP6Targets +} + +// ARPValidate implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ARPValidate() optional.Optional[nethelpers.ARPValidate] { + if s.BondARPValidate == nil { + return optional.None[nethelpers.ARPValidate]() + } + + return optional.Some(*s.BondARPValidate) +} + +// ARPAllTargets implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ARPAllTargets() optional.Optional[nethelpers.ARPAllTargets] { + if s.BondARPAllTargets == nil { + return optional.None[nethelpers.ARPAllTargets]() + } + + return optional.Some(*s.BondARPAllTargets) +} + +// LACPRate implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) LACPRate() optional.Optional[nethelpers.LACPRate] { + if s.BondLACPRate == nil { + return optional.None[nethelpers.LACPRate]() + } + + return optional.Some(*s.BondLACPRate) +} + +// FailOverMAC implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) FailOverMAC() optional.Optional[nethelpers.FailOverMAC] { + if s.BondFailOverMAC == nil { + return optional.None[nethelpers.FailOverMAC]() + } + + return optional.Some(*s.BondFailOverMAC) +} + +// ADSelect implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ADSelect() optional.Optional[nethelpers.ADSelect] { + if s.BondADSelect == nil { + return optional.None[nethelpers.ADSelect]() + } + + return optional.Some(*s.BondADSelect) +} + +// ADActorSysPrio implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ADActorSysPrio() optional.Optional[uint16] { + if s.BondADActorSysPrio == nil { + return optional.None[uint16]() + } + + return optional.Some(*s.BondADActorSysPrio) +} + +// ADUserPortKey implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ADUserPortKey() optional.Optional[uint16] { + if s.BondADUserPortKey == nil { + return optional.None[uint16]() + } + + return optional.Some(*s.BondADUserPortKey) +} + +// ADLACPActive implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ADLACPActive() optional.Optional[nethelpers.ADLACPActive] { + if s.BondADLACPActive == nil { + return optional.None[nethelpers.ADLACPActive]() + } + + return optional.Some(*s.BondADLACPActive) +} + +// PrimaryReselect implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) PrimaryReselect() optional.Optional[nethelpers.PrimaryReselect] { + if s.BondPrimaryReselect == nil { + return optional.None[nethelpers.PrimaryReselect]() + } + + return optional.Some(*s.BondPrimaryReselect) +} + +// ResendIGMP implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) ResendIGMP() optional.Optional[uint32] { + if s.BondResendIGMP == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondResendIGMP) +} + +// MinLinks implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) MinLinks() optional.Optional[uint32] { + if s.BondMinLinks == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondMinLinks) +} + +// LPInterval implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) LPInterval() optional.Optional[uint32] { + if s.BondLPInterval == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondLPInterval) +} + +// PacketsPerSlave implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) PacketsPerSlave() optional.Optional[uint32] { + if s.BondPacketsPerSlave == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondPacketsPerSlave) +} + +// NumPeerNotif implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) NumPeerNotif() optional.Optional[uint8] { + if s.BondNumPeerNotif == nil { + return optional.None[uint8]() + } + + return optional.Some(*s.BondNumPeerNotif) +} + +// TLBDynamicLB implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) TLBDynamicLB() optional.Optional[uint8] { + if s.BondTLBDynamicLB == nil { + return optional.None[uint8]() + } + + return optional.Some(*s.BondTLBDynamicLB) +} + +// AllSlavesActive implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) AllSlavesActive() optional.Optional[uint8] { + if s.BondAllSlavesActive == nil { + return optional.None[uint8]() + } + + return optional.Some(*s.BondAllSlavesActive) +} + +// PeerNotifyDelay implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) PeerNotifyDelay() optional.Optional[uint32] { + if s.BondPeerNotifyDelay == nil { + return optional.None[uint32]() + } + + return optional.Some(*s.BondPeerNotifyDelay) +} + +// MissedMax implements NetworkBondConfig interface. +func (s *BondConfigV1Alpha1) MissedMax() optional.Optional[uint8] { + if s.BondMissedMax == nil { + return optional.None[uint8]() + } + + return optional.Some(*s.BondMissedMax) +} + +// HardwareAddress implements NetworkDummyLinkConfig interface. +func (s *BondConfigV1Alpha1) HardwareAddress() optional.Optional[nethelpers.HardwareAddr] { + if len(s.HardwareAddressConfig) == 0 { + return optional.None[nethelpers.HardwareAddr]() + } + + return optional.Some(s.HardwareAddressConfig) +} diff --git a/pkg/machinery/config/types/network/bond_test.go b/pkg/machinery/config/types/network/bond_test.go new file mode 100644 index 000000000..49f245726 --- /dev/null +++ b/pkg/machinery/config/types/network/bond_test.go @@ -0,0 +1,175 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package network_test + +import ( + _ "embed" + "net/netip" + "testing" + + "github.com/siderolabs/go-pointer" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/siderolabs/talos/pkg/machinery/config/configloader" + "github.com/siderolabs/talos/pkg/machinery/config/encoder" + "github.com/siderolabs/talos/pkg/machinery/config/types/meta" + "github.com/siderolabs/talos/pkg/machinery/config/types/network" + "github.com/siderolabs/talos/pkg/machinery/nethelpers" +) + +//go:embed testdata/bondconfig.yaml +var expectedBondConfigDocument []byte + +func TestBondConfigMarshalStability(t *testing.T) { + t.Parallel() + + cfg := network.NewBondConfigV1Alpha1("agg.0") + cfg.BondLinks = []string{"eth0", "eth1"} + cfg.BondMode = pointer.To(nethelpers.BondMode8023AD) + cfg.BondXmitHashPolicy = pointer.To(nethelpers.BondXmitPolicyLayer34) + cfg.BondLACPRate = pointer.To(nethelpers.LACPRateSlow) + cfg.BondMIIMon = pointer.To(uint32(100)) + cfg.BondUpDelay = pointer.To(uint32(200)) + cfg.BondDownDelay = pointer.To(uint32(200)) + cfg.BondResendIGMP = pointer.To(uint32(1)) + cfg.BondPacketsPerSlave = pointer.To(uint32(1)) + cfg.BondADActorSysPrio = pointer.To(uint16(65535)) + cfg.LinkUp = pointer.To(true) + cfg.LinkAddresses = []network.AddressConfig{ + { + AddressAddress: netip.MustParsePrefix("1.2.3.4/24"), + }, + } + + marshaled, err := encoder.NewEncoder(cfg, encoder.WithComments(encoder.CommentsDisabled)).Encode() + require.NoError(t, err) + + t.Log(string(marshaled)) + + assert.Equal(t, expectedBondConfigDocument, marshaled) +} + +func TestBondConfigUnmarshal(t *testing.T) { + t.Parallel() + + provider, err := configloader.NewFromBytes(expectedBondConfigDocument) + require.NoError(t, err) + + docs := provider.Documents() + require.Len(t, docs, 1) + + assert.Equal(t, &network.BondConfigV1Alpha1{ + Meta: meta.Meta{ + MetaAPIVersion: "v1alpha1", + MetaKind: network.BondKind, + }, + MetaName: "agg.0", + BondLinks: []string{"eth0", "eth1"}, + BondMode: pointer.To(nethelpers.BondMode8023AD), + BondXmitHashPolicy: pointer.To(nethelpers.BondXmitPolicyLayer34), + BondLACPRate: pointer.To(nethelpers.LACPRateSlow), + BondMIIMon: pointer.To(uint32(100)), + BondUpDelay: pointer.To(uint32(200)), + BondDownDelay: pointer.To(uint32(200)), + BondResendIGMP: pointer.To(uint32(1)), + BondPacketsPerSlave: pointer.To(uint32(1)), + BondADActorSysPrio: pointer.To(uint16(65535)), + CommonLinkConfig: network.CommonLinkConfig{ + LinkUp: pointer.To(true), + LinkAddresses: []network.AddressConfig{ + { + AddressAddress: netip.MustParsePrefix("1.2.3.4/24"), + }, + }, + }, + }, docs[0]) +} + +func TestBondValidate(t *testing.T) { + t.Parallel() + + for _, test := range []struct { + name string + cfg func() *network.BondConfigV1Alpha1 + + expectedError string + expectedWarnings []string + }{ + { + name: "empty", + cfg: func() *network.BondConfigV1Alpha1 { + return network.NewBondConfigV1Alpha1("") + }, + + expectedError: "name must be specified\nat least one link must be specified\nbond mode must be specified", + }, + { + name: "no links", + + cfg: func() *network.BondConfigV1Alpha1 { + cfg := network.NewBondConfigV1Alpha1("bond0") + cfg.BondMode = pointer.To(nethelpers.BondModeActiveBackup) + + return cfg + }, + + expectedError: "at least one link must be specified", + }, + { + name: "no mode", + + cfg: func() *network.BondConfigV1Alpha1 { + cfg := network.NewBondConfigV1Alpha1("bond0") + cfg.BondLinks = []string{"eth0", "eth1"} + + return cfg + }, + + expectedError: "bond mode must be specified", + }, + { + name: "valid", + cfg: func() *network.BondConfigV1Alpha1 { + cfg := network.NewBondConfigV1Alpha1("bond25") + cfg.BondLinks = []string{"eth0", "eth1"} + cfg.BondMode = pointer.To(nethelpers.BondMode8023AD) + cfg.LinkAddresses = []network.AddressConfig{ + { + AddressAddress: netip.MustParsePrefix("192.168.1.100/24"), + }, + { + AddressAddress: netip.MustParsePrefix("fd00::1/64"), + }, + } + cfg.LinkRoutes = []network.RouteConfig{ + { + RouteDestination: network.Prefix{netip.MustParsePrefix("10.3.5.0/24")}, + RouteGateway: network.Addr{netip.MustParseAddr("10.3.5.1")}, + }, + { + RouteGateway: network.Addr{netip.MustParseAddr("fe80::1")}, + }, + } + + return cfg + }, + }, + } { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + warnings, err := test.cfg().Validate(validationMode{}) + + assert.Equal(t, test.expectedWarnings, warnings) + + if test.expectedError != "" { + assert.EqualError(t, err, test.expectedError) + } else { + assert.NoError(t, err) + } + }) + } +} diff --git a/pkg/machinery/config/types/network/deep_copy.generated.go b/pkg/machinery/config/types/network/deep_copy.generated.go index 36160b833..f04e309b4 100644 --- a/pkg/machinery/config/types/network/deep_copy.generated.go +++ b/pkg/machinery/config/types/network/deep_copy.generated.go @@ -2,7 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -// Code generated by "deep-copy -type DefaultActionConfigV1Alpha1 -type DHCPv4ConfigV1Alpha1 -type DHCPv6ConfigV1Alpha1 -type DummyLinkConfigV1Alpha1 -type EthernetConfigV1Alpha1 -type HCloudVIPConfigV1Alpha1 -type HostnameConfigV1Alpha1 -type KubespanEndpointsConfigV1Alpha1 -type Layer2VIPConfigV1Alpha1 -type LinkConfigV1Alpha1 -type LinkAliasConfigV1Alpha1 -type RuleConfigV1Alpha1 -type StaticHostConfigV1Alpha1 -type VLANConfigV1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT. +// Code generated by "deep-copy -type BondConfigV1Alpha1 -type DefaultActionConfigV1Alpha1 -type DHCPv4ConfigV1Alpha1 -type DHCPv6ConfigV1Alpha1 -type DummyLinkConfigV1Alpha1 -type EthernetConfigV1Alpha1 -type HCloudVIPConfigV1Alpha1 -type HostnameConfigV1Alpha1 -type KubespanEndpointsConfigV1Alpha1 -type Layer2VIPConfigV1Alpha1 -type LinkConfigV1Alpha1 -type LinkAliasConfigV1Alpha1 -type RuleConfigV1Alpha1 -type StaticHostConfigV1Alpha1 -type VLANConfigV1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT. package network @@ -12,6 +12,146 @@ import ( "github.com/siderolabs/talos/pkg/machinery/nethelpers" ) +// DeepCopy generates a deep copy of *BondConfigV1Alpha1. +func (o *BondConfigV1Alpha1) DeepCopy() *BondConfigV1Alpha1 { + var cp BondConfigV1Alpha1 = *o + if o.HardwareAddressConfig != nil { + cp.HardwareAddressConfig = make([]byte, len(o.HardwareAddressConfig)) + copy(cp.HardwareAddressConfig, o.HardwareAddressConfig) + } + if o.BondLinks != nil { + cp.BondLinks = make([]string, len(o.BondLinks)) + copy(cp.BondLinks, o.BondLinks) + } + if o.BondMode != nil { + cp.BondMode = new(nethelpers.BondMode) + *cp.BondMode = *o.BondMode + } + if o.BondMIIMon != nil { + cp.BondMIIMon = new(uint32) + *cp.BondMIIMon = *o.BondMIIMon + } + if o.BondUpDelay != nil { + cp.BondUpDelay = new(uint32) + *cp.BondUpDelay = *o.BondUpDelay + } + if o.BondDownDelay != nil { + cp.BondDownDelay = new(uint32) + *cp.BondDownDelay = *o.BondDownDelay + } + if o.BondUseCarrier != nil { + cp.BondUseCarrier = new(bool) + *cp.BondUseCarrier = *o.BondUseCarrier + } + if o.BondXmitHashPolicy != nil { + cp.BondXmitHashPolicy = new(nethelpers.BondXmitHashPolicy) + *cp.BondXmitHashPolicy = *o.BondXmitHashPolicy + } + if o.BondARPInterval != nil { + cp.BondARPInterval = new(uint32) + *cp.BondARPInterval = *o.BondARPInterval + } + if o.BondARPIPTargets != nil { + cp.BondARPIPTargets = make([]netip.Addr, len(o.BondARPIPTargets)) + copy(cp.BondARPIPTargets, o.BondARPIPTargets) + } + if o.BondNSIP6Targets != nil { + cp.BondNSIP6Targets = make([]netip.Addr, len(o.BondNSIP6Targets)) + copy(cp.BondNSIP6Targets, o.BondNSIP6Targets) + } + if o.BondARPValidate != nil { + cp.BondARPValidate = new(nethelpers.ARPValidate) + *cp.BondARPValidate = *o.BondARPValidate + } + if o.BondARPAllTargets != nil { + cp.BondARPAllTargets = new(nethelpers.ARPAllTargets) + *cp.BondARPAllTargets = *o.BondARPAllTargets + } + if o.BondLACPRate != nil { + cp.BondLACPRate = new(nethelpers.LACPRate) + *cp.BondLACPRate = *o.BondLACPRate + } + if o.BondFailOverMAC != nil { + cp.BondFailOverMAC = new(nethelpers.FailOverMAC) + *cp.BondFailOverMAC = *o.BondFailOverMAC + } + if o.BondADSelect != nil { + cp.BondADSelect = new(nethelpers.ADSelect) + *cp.BondADSelect = *o.BondADSelect + } + if o.BondADActorSysPrio != nil { + cp.BondADActorSysPrio = new(uint16) + *cp.BondADActorSysPrio = *o.BondADActorSysPrio + } + if o.BondADUserPortKey != nil { + cp.BondADUserPortKey = new(uint16) + *cp.BondADUserPortKey = *o.BondADUserPortKey + } + if o.BondADLACPActive != nil { + cp.BondADLACPActive = new(nethelpers.ADLACPActive) + *cp.BondADLACPActive = *o.BondADLACPActive + } + if o.BondPrimaryReselect != nil { + cp.BondPrimaryReselect = new(nethelpers.PrimaryReselect) + *cp.BondPrimaryReselect = *o.BondPrimaryReselect + } + if o.BondResendIGMP != nil { + cp.BondResendIGMP = new(uint32) + *cp.BondResendIGMP = *o.BondResendIGMP + } + if o.BondMinLinks != nil { + cp.BondMinLinks = new(uint32) + *cp.BondMinLinks = *o.BondMinLinks + } + if o.BondLPInterval != nil { + cp.BondLPInterval = new(uint32) + *cp.BondLPInterval = *o.BondLPInterval + } + if o.BondPacketsPerSlave != nil { + cp.BondPacketsPerSlave = new(uint32) + *cp.BondPacketsPerSlave = *o.BondPacketsPerSlave + } + if o.BondNumPeerNotif != nil { + cp.BondNumPeerNotif = new(uint8) + *cp.BondNumPeerNotif = *o.BondNumPeerNotif + } + if o.BondTLBDynamicLB != nil { + cp.BondTLBDynamicLB = new(uint8) + *cp.BondTLBDynamicLB = *o.BondTLBDynamicLB + } + if o.BondAllSlavesActive != nil { + cp.BondAllSlavesActive = new(uint8) + *cp.BondAllSlavesActive = *o.BondAllSlavesActive + } + if o.BondPeerNotifyDelay != nil { + cp.BondPeerNotifyDelay = new(uint32) + *cp.BondPeerNotifyDelay = *o.BondPeerNotifyDelay + } + if o.BondMissedMax != nil { + cp.BondMissedMax = new(uint8) + *cp.BondMissedMax = *o.BondMissedMax + } + if o.CommonLinkConfig.LinkUp != nil { + cp.CommonLinkConfig.LinkUp = new(bool) + *cp.CommonLinkConfig.LinkUp = *o.CommonLinkConfig.LinkUp + } + if o.CommonLinkConfig.LinkAddresses != nil { + cp.CommonLinkConfig.LinkAddresses = make([]AddressConfig, len(o.CommonLinkConfig.LinkAddresses)) + copy(cp.CommonLinkConfig.LinkAddresses, o.CommonLinkConfig.LinkAddresses) + for i3 := range o.CommonLinkConfig.LinkAddresses { + if o.CommonLinkConfig.LinkAddresses[i3].AddressPriority != nil { + cp.CommonLinkConfig.LinkAddresses[i3].AddressPriority = new(uint32) + *cp.CommonLinkConfig.LinkAddresses[i3].AddressPriority = *o.CommonLinkConfig.LinkAddresses[i3].AddressPriority + } + } + } + if o.CommonLinkConfig.LinkRoutes != nil { + cp.CommonLinkConfig.LinkRoutes = make([]RouteConfig, len(o.CommonLinkConfig.LinkRoutes)) + copy(cp.CommonLinkConfig.LinkRoutes, o.CommonLinkConfig.LinkRoutes) + } + return &cp +} + // DeepCopy generates a deep copy of *DefaultActionConfigV1Alpha1. func (o *DefaultActionConfigV1Alpha1) DeepCopy() *DefaultActionConfigV1Alpha1 { var cp DefaultActionConfigV1Alpha1 = *o diff --git a/pkg/machinery/config/types/network/link.go b/pkg/machinery/config/types/network/link.go index e039ff300..4b5d6d989 100644 --- a/pkg/machinery/config/types/network/link.go +++ b/pkg/machinery/config/types/network/link.go @@ -38,6 +38,7 @@ func init() { func conflictingLinkKinds(selfKind string) []string { return xslices.Filter([]string{ + BondKind, DummyLinkKind, LinkKind, VLANKind, diff --git a/pkg/machinery/config/types/network/network.go b/pkg/machinery/config/types/network/network.go index 5495dba72..ade6e2d9a 100644 --- a/pkg/machinery/config/types/network/network.go +++ b/pkg/machinery/config/types/network/network.go @@ -5,6 +5,6 @@ // Package network provides network machine configuration documents. package network -//go:generate go tool github.com/siderolabs/talos/tools/docgen -output network_doc.go network.go default_action_config.go dhcp4.go dhcp6.go dummy.go ethernet.go hcloud_vip.go hostname.go kubespan_endpoints.go layer2_vip.go link.go link_alias.go port_range.go rule_config.go static_host.go vlan.go +//go:generate go tool github.com/siderolabs/talos/tools/docgen -output network_doc.go network.go bond.go default_action_config.go dhcp4.go dhcp6.go dummy.go ethernet.go hcloud_vip.go hostname.go kubespan_endpoints.go layer2_vip.go link.go link_alias.go port_range.go rule_config.go static_host.go vlan.go -//go:generate go tool github.com/siderolabs/deep-copy -type DefaultActionConfigV1Alpha1 -type DHCPv4ConfigV1Alpha1 -type DHCPv6ConfigV1Alpha1 -type DummyLinkConfigV1Alpha1 -type EthernetConfigV1Alpha1 -type HCloudVIPConfigV1Alpha1 -type HostnameConfigV1Alpha1 -type KubespanEndpointsConfigV1Alpha1 -type Layer2VIPConfigV1Alpha1 -type LinkConfigV1Alpha1 -type LinkAliasConfigV1Alpha1 -type RuleConfigV1Alpha1 -type StaticHostConfigV1Alpha1 -type VLANConfigV1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go . +//go:generate go tool github.com/siderolabs/deep-copy -type BondConfigV1Alpha1 -type DefaultActionConfigV1Alpha1 -type DHCPv4ConfigV1Alpha1 -type DHCPv6ConfigV1Alpha1 -type DummyLinkConfigV1Alpha1 -type EthernetConfigV1Alpha1 -type HCloudVIPConfigV1Alpha1 -type HostnameConfigV1Alpha1 -type KubespanEndpointsConfigV1Alpha1 -type Layer2VIPConfigV1Alpha1 -type LinkConfigV1Alpha1 -type LinkAliasConfigV1Alpha1 -type RuleConfigV1Alpha1 -type StaticHostConfigV1Alpha1 -type VLANConfigV1Alpha1 -pointer-receiver -header-file ../../../../../hack/boilerplate.txt -o deep_copy.generated.go . diff --git a/pkg/machinery/config/types/network/network_doc.go b/pkg/machinery/config/types/network/network_doc.go index 09c7b9eb4..050253c9d 100644 --- a/pkg/machinery/config/types/network/network_doc.go +++ b/pkg/machinery/config/types/network/network_doc.go @@ -13,6 +13,313 @@ import ( "github.com/siderolabs/talos/pkg/machinery/nethelpers" ) +func (BondConfigV1Alpha1) Doc() *encoder.Doc { + doc := &encoder.Doc{ + Type: "BondConfig", + Comments: [3]string{"" /* encoder.HeadComment */, "BondConfig is a config document to create a bond (link aggregation) over a set of links." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Description: "BondConfig is a config document to create a bond (link aggregation) over a set of links.", + Fields: []encoder.Doc{ + { + Type: "Meta", + Inline: true, + }, + { + Name: "name", + Type: "string", + Note: "", + Description: "Name of the bond link (interface) to be created.", + Comments: [3]string{"" /* encoder.HeadComment */, "Name of the bond link (interface) to be created." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "hardwareAddr", + Type: "HardwareAddr", + Note: "", + Description: "Override the hardware (MAC) address of the link.", + Comments: [3]string{"" /* encoder.HeadComment */, "Override the hardware (MAC) address of the link." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "links", + Type: "[]string", + Note: "", + Description: "Names of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.", + Comments: [3]string{"" /* encoder.HeadComment */, "Names of the links (interfaces) on which the bond will be created." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "bondMode", + Type: "BondMode", + Note: "", + Description: "Bond mode.", + Comments: [3]string{"" /* encoder.HeadComment */, "Bond mode." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "balance-rr", + "active-backup", + "balance-xor", + "broadcast", + "802.3ad", + "balance-tlb", + "balance-alb", + }, + }, + { + Name: "miimon", + Type: "uint32", + Note: "", + Description: "Link monitoring frequency in milliseconds.", + Comments: [3]string{"" /* encoder.HeadComment */, "Link monitoring frequency in milliseconds." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "updelay", + Type: "uint32", + Note: "", + Description: "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.", + Comments: [3]string{"" /* encoder.HeadComment */, "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "downdelay", + Type: "uint32", + Note: "", + Description: "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.", + Comments: [3]string{"" /* encoder.HeadComment */, "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "useCarrier", + Type: "bool", + Note: "", + Description: "Specifies whether or not miimon should use MII or ETHTOOL.", + Comments: [3]string{"" /* encoder.HeadComment */, "Specifies whether or not miimon should use MII or ETHTOOL." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "xmitHashPolicy", + Type: "BondXmitHashPolicy", + Note: "", + Description: "Selects the transmit hash policy to use for slave selection.", + Comments: [3]string{"" /* encoder.HeadComment */, "Selects the transmit hash policy to use for slave selection." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "layer2", + "layer3+4", + "layer2+3", + "encap2+3", + "encap3+4", + }, + }, + { + Name: "arpInterval", + Type: "uint32", + Note: "", + Description: "ARP link monitoring frequency in milliseconds.", + Comments: [3]string{"" /* encoder.HeadComment */, "ARP link monitoring frequency in milliseconds." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "arpIpTargets", + Type: "[]Addr", + Note: "", + Description: "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + Comments: [3]string{"" /* encoder.HeadComment */, "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "nsIp6Targets", + Type: "[]Addr", + Note: "", + Description: "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + Comments: [3]string{"" /* encoder.HeadComment */, "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "arpValidate", + Type: "ARPValidate", + Note: "", + Description: "Specifies whether or not ARP probes and replies should be validated.", + Comments: [3]string{"" /* encoder.HeadComment */, "Specifies whether or not ARP probes and replies should be validated." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "none", + "active", + "backup", + "all", + "filter", + "filter-active", + "filter-backup", + }, + }, + { + Name: "arpAllTargets", + Type: "ARPAllTargets", + Note: "", + Description: "Specifies whether ARP probes should be sent to any or all targets.", + Comments: [3]string{"" /* encoder.HeadComment */, "Specifies whether ARP probes should be sent to any or all targets." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "any", + "all", + }, + }, + { + Name: "lacpRate", + Type: "LACPRate", + Note: "", + Description: "LACPDU frames periodic transmission rate.", + Comments: [3]string{"" /* encoder.HeadComment */, "LACPDU frames periodic transmission rate." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "slow", + "fast", + }, + }, + { + Name: "failOverMac", + Type: "FailOverMAC", + Note: "", + Description: "Specifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.", + Comments: [3]string{"" /* encoder.HeadComment */, "Specifies whether active-backup mode should set all slaves to the same MAC address" /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "none", + "active", + "follow", + }, + }, + { + Name: "adSelect", + Type: "ADSelect", + Note: "", + Description: "Aggregate selection policy for 802.3ad.", + Comments: [3]string{"" /* encoder.HeadComment */, "Aggregate selection policy for 802.3ad." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "stable", + "bandwidth", + "count", + }, + }, + { + Name: "adActorSysPrio", + Type: "uint16", + Note: "", + Description: "Actor system priority for 802.3ad.", + Comments: [3]string{"" /* encoder.HeadComment */, "Actor system priority for 802.3ad." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "adUserPortKey", + Type: "uint16", + Note: "", + Description: "User port key (upper 10 bits) for 802.3ad.", + Comments: [3]string{"" /* encoder.HeadComment */, "User port key (upper 10 bits) for 802.3ad." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "adLACPActive", + Type: "ADLACPActive", + Note: "", + Description: "Whether to send LACPDU frames periodically.", + Comments: [3]string{"" /* encoder.HeadComment */, "Whether to send LACPDU frames periodically." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "on", + "off", + }, + }, + { + Name: "primaryReselect", + Type: "PrimaryReselect", + Note: "", + Description: "Policy under which the primary slave should be reselected.", + Comments: [3]string{"" /* encoder.HeadComment */, "Policy under which the primary slave should be reselected." /* encoder.LineComment */, "" /* encoder.FootComment */}, + Values: []string{ + "always", + "better", + "failure", + }, + }, + { + Name: "resendIGMP", + Type: "uint32", + Note: "", + Description: "The number of times IGMP packets should be resent.", + Comments: [3]string{"" /* encoder.HeadComment */, "The number of times IGMP packets should be resent." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "minLinks", + Type: "uint32", + Note: "", + Description: "The minimum number of active links required for the bond to be considered active.", + Comments: [3]string{"" /* encoder.HeadComment */, "The minimum number of active links required for the bond to be considered active." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "lpInterval", + Type: "uint32", + Note: "", + Description: "The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch.", + Comments: [3]string{"" /* encoder.HeadComment */, "The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "packetsPerSlave", + Type: "uint32", + Note: "", + Description: "The number of packets to transmit through a slave before moving to the next one.", + Comments: [3]string{"" /* encoder.HeadComment */, "The number of packets to transmit through a slave before moving to the next one." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "numPeerNotif", + Type: "uint8", + Note: "", + Description: "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.", + Comments: [3]string{"" /* encoder.HeadComment */, "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)" /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "tlbLogicalLb", + Type: "uint8", + Note: "", + Description: "Whether dynamic shuffling of flows is enabled in tlb or alb mode.", + Comments: [3]string{"" /* encoder.HeadComment */, "Whether dynamic shuffling of flows is enabled in tlb or alb mode." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "allSlavesActive", + Type: "uint8", + Note: "", + Description: "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).", + Comments: [3]string{"" /* encoder.HeadComment */, "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1)." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "peerNotifDelay", + Type: "uint32", + Note: "", + Description: "The delay, in milliseconds, between each peer notification.", + Comments: [3]string{"" /* encoder.HeadComment */, "The delay, in milliseconds, between each peer notification." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Name: "missedMax", + Type: "uint8", + Note: "", + Description: "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.", + Comments: [3]string{"" /* encoder.HeadComment */, "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor." /* encoder.LineComment */, "" /* encoder.FootComment */}, + }, + { + Type: "CommonLinkConfig", + Inline: true, + }, + }, + } + + doc.AddExample("", exampleBondConfigV1Alpha1()) + + doc.Fields[1].AddExample("", "bond.ext") + doc.Fields[2].AddExample("", nethelpers.HardwareAddr{0x2e, 0x3c, 0x4d, 0x5e, 0x6f, 0x70}) + doc.Fields[3].AddExample("", []string{"enp0s3", "enp0s8"}) + doc.Fields[4].AddExample("", "802.3ad") + doc.Fields[5].AddExample("", 200) + doc.Fields[6].AddExample("", 300) + doc.Fields[7].AddExample("", 100) + doc.Fields[9].AddExample("", "layer2") + doc.Fields[10].AddExample("", 1000) + doc.Fields[11].AddExample("", []netip.Addr{netip.MustParseAddr("10.15.0.1")}) + doc.Fields[12].AddExample("", []netip.Addr{netip.MustParseAddr("fd00::1")}) + doc.Fields[13].AddExample("", "active") + doc.Fields[14].AddExample("", "all") + doc.Fields[15].AddExample("", "fast") + doc.Fields[16].AddExample("", "active") + doc.Fields[17].AddExample("", "stable") + doc.Fields[18].AddExample("", 65535) + doc.Fields[19].AddExample("", 0) + doc.Fields[20].AddExample("", "on") + doc.Fields[21].AddExample("", "always") + doc.Fields[27].AddExample("", 1) + doc.Fields[28].AddExample("", 0) + + return doc +} + func (DefaultActionConfigV1Alpha1) Doc() *encoder.Doc { doc := &encoder.Doc{ Type: "NetworkDefaultActionConfig", @@ -583,6 +890,10 @@ func (CommonLinkConfig) Doc() *encoder.Doc { Comments: [3]string{"" /* encoder.HeadComment */, "CommonLinkConfig is common configuration for network links, and logical links." /* encoder.LineComment */, "" /* encoder.FootComment */}, Description: "CommonLinkConfig is common configuration for network links, and logical links.", AppearsIn: []encoder.Appearance{ + { + TypeName: "BondConfigV1Alpha1", + FieldName: "", + }, { TypeName: "DummyLinkConfigV1Alpha1", FieldName: "", @@ -980,7 +1291,7 @@ func (VLANConfigV1Alpha1) Doc() *encoder.Doc { Name: "parent", Type: "string", Note: "", - Description: "Name of the parent link (interface) on which the VLAN link will be created.", + Description: "Name of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.", Comments: [3]string{"" /* encoder.HeadComment */, "Name of the parent link (interface) on which the VLAN link will be created." /* encoder.LineComment */, "" /* encoder.FootComment */}, }, { @@ -1006,6 +1317,7 @@ func GetFileDoc() *encoder.FileDoc { Name: "network", Description: "Package network provides network machine configuration documents.\n", Structs: []*encoder.Doc{ + BondConfigV1Alpha1{}.Doc(), DefaultActionConfigV1Alpha1{}.Doc(), DHCPv4ConfigV1Alpha1{}.Doc(), DHCPv6ConfigV1Alpha1{}.Doc(), diff --git a/pkg/machinery/config/types/network/testdata/bondconfig.yaml b/pkg/machinery/config/types/network/testdata/bondconfig.yaml new file mode 100644 index 000000000..22248973a --- /dev/null +++ b/pkg/machinery/config/types/network/testdata/bondconfig.yaml @@ -0,0 +1,18 @@ +apiVersion: v1alpha1 +kind: BondConfig +name: agg.0 +links: + - eth0 + - eth1 +bondMode: 802.3ad +miimon: 100 +updelay: 200 +downdelay: 200 +xmitHashPolicy: layer3+4 +lacpRate: slow +adActorSysPrio: 65535 +resendIGMP: 1 +packetsPerSlave: 1 +up: true +addresses: + - address: 1.2.3.4/24 diff --git a/pkg/machinery/config/types/network/vlan.go b/pkg/machinery/config/types/network/vlan.go index 411e4d040..da8b87ef7 100644 --- a/pkg/machinery/config/types/network/vlan.go +++ b/pkg/machinery/config/types/network/vlan.go @@ -80,6 +80,7 @@ type VLANConfigV1Alpha1 struct { VLANModeConfig *nethelpers.VLANProtocol `yaml:"vlanMode,omitempty"` // description: | // Name of the parent link (interface) on which the VLAN link will be created. + // Link aliases can be used here as well. // // examples: // - value: > diff --git a/pkg/machinery/nethelpers/adlacpactive.go b/pkg/machinery/nethelpers/adlacpactive.go new file mode 100644 index 000000000..64e33f895 --- /dev/null +++ b/pkg/machinery/nethelpers/adlacpactive.go @@ -0,0 +1,16 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package nethelpers + +// ADLACPActive is ADLACPActive. +type ADLACPActive uint8 + +// ADLACPActive constants. +// +//structprotogen:gen_enum +const ( + ADLACPActiveOff ADLACPActive = iota // off + ADLACPActiveOn // on +) diff --git a/pkg/machinery/nethelpers/arpalltargets_enumer.go b/pkg/machinery/nethelpers/arpalltargets_enumer.go index c86601362..d3572b5d6 100644 --- a/pkg/machinery/nethelpers/arpalltargets_enumer.go +++ b/pkg/machinery/nethelpers/arpalltargets_enumer.go @@ -1,4 +1,4 @@ -// Code generated by "enumer -type=ARPAllTargets,ARPValidate,AddressFlag,AddressSortAlgorithm,ADSelect,AutoHostnameKind,BondMode,BondXmitHashPolicy,ClientIdentifier,ConntrackState,DefaultAction,Duplex,Family,LACPRate,LinkFlag,LinkType,MatchOperator,NfTablesChainHook,NfTablesChainPriority,NfTablesVerdict,OperationalState,Port,PrimaryReselect,Protocol,RouteFlag,RouteProtocol,RouteType,RoutingTable,Scope,Status,VLANProtocol,WOLMode -linecomment -text"; DO NOT EDIT. +// Code generated by "enumer -type=ARPAllTargets,ARPValidate,AddressFlag,AddressSortAlgorithm,ADSelect,ADLACPActive,AutoHostnameKind,BondMode,BondXmitHashPolicy,ClientIdentifier,ConntrackState,DefaultAction,Duplex,Family,LACPRate,LinkFlag,LinkType,MatchOperator,NfTablesChainHook,NfTablesChainPriority,NfTablesVerdict,OperationalState,Port,PrimaryReselect,Protocol,RouteFlag,RouteProtocol,RouteType,RoutingTable,Scope,Status,VLANProtocol,WOLMode -linecomment -text"; DO NOT EDIT. package nethelpers @@ -89,11 +89,11 @@ func (i *ARPAllTargets) UnmarshalText(text []byte) error { return err } -const _ARPValidateName = "noneactivebackupall" +const _ARPValidateName = "noneactivebackupallfilterfilter-activefilter-backup" -var _ARPValidateIndex = [...]uint8{0, 4, 10, 16, 19} +var _ARPValidateIndex = [...]uint8{0, 4, 10, 16, 19, 25, 38, 51} -const _ARPValidateLowerName = "noneactivebackupall" +const _ARPValidateLowerName = "noneactivebackupallfilterfilter-activefilter-backup" func (i ARPValidate) String() string { if i >= ARPValidate(len(_ARPValidateIndex)-1) { @@ -110,9 +110,12 @@ func _ARPValidateNoOp() { _ = x[ARPValidateActive-(1)] _ = x[ARPValidateBackup-(2)] _ = x[ARPValidateAll-(3)] + _ = x[ARPValidateFilter-(4)] + _ = x[ARPValidateFilterActive-(5)] + _ = x[ARPValidateFilterBackup-(6)] } -var _ARPValidateValues = []ARPValidate{ARPValidateNone, ARPValidateActive, ARPValidateBackup, ARPValidateAll} +var _ARPValidateValues = []ARPValidate{ARPValidateNone, ARPValidateActive, ARPValidateBackup, ARPValidateAll, ARPValidateFilter, ARPValidateFilterActive, ARPValidateFilterBackup} var _ARPValidateNameToValueMap = map[string]ARPValidate{ _ARPValidateName[0:4]: ARPValidateNone, @@ -123,6 +126,12 @@ var _ARPValidateNameToValueMap = map[string]ARPValidate{ _ARPValidateLowerName[10:16]: ARPValidateBackup, _ARPValidateName[16:19]: ARPValidateAll, _ARPValidateLowerName[16:19]: ARPValidateAll, + _ARPValidateName[19:25]: ARPValidateFilter, + _ARPValidateLowerName[19:25]: ARPValidateFilter, + _ARPValidateName[25:38]: ARPValidateFilterActive, + _ARPValidateLowerName[25:38]: ARPValidateFilterActive, + _ARPValidateName[38:51]: ARPValidateFilterBackup, + _ARPValidateLowerName[38:51]: ARPValidateFilterBackup, } var _ARPValidateNames = []string{ @@ -130,6 +139,9 @@ var _ARPValidateNames = []string{ _ARPValidateName[4:10], _ARPValidateName[10:16], _ARPValidateName[16:19], + _ARPValidateName[19:25], + _ARPValidateName[25:38], + _ARPValidateName[38:51], } // ARPValidateString retrieves an enum value from the enum constants string name. @@ -477,6 +489,88 @@ func (i *ADSelect) UnmarshalText(text []byte) error { return err } +const _ADLACPActiveName = "offon" + +var _ADLACPActiveIndex = [...]uint8{0, 3, 5} + +const _ADLACPActiveLowerName = "offon" + +func (i ADLACPActive) String() string { + if i >= ADLACPActive(len(_ADLACPActiveIndex)-1) { + return fmt.Sprintf("ADLACPActive(%d)", i) + } + return _ADLACPActiveName[_ADLACPActiveIndex[i]:_ADLACPActiveIndex[i+1]] +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _ADLACPActiveNoOp() { + var x [1]struct{} + _ = x[ADLACPActiveOff-(0)] + _ = x[ADLACPActiveOn-(1)] +} + +var _ADLACPActiveValues = []ADLACPActive{ADLACPActiveOff, ADLACPActiveOn} + +var _ADLACPActiveNameToValueMap = map[string]ADLACPActive{ + _ADLACPActiveName[0:3]: ADLACPActiveOff, + _ADLACPActiveLowerName[0:3]: ADLACPActiveOff, + _ADLACPActiveName[3:5]: ADLACPActiveOn, + _ADLACPActiveLowerName[3:5]: ADLACPActiveOn, +} + +var _ADLACPActiveNames = []string{ + _ADLACPActiveName[0:3], + _ADLACPActiveName[3:5], +} + +// ADLACPActiveString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func ADLACPActiveString(s string) (ADLACPActive, error) { + if val, ok := _ADLACPActiveNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _ADLACPActiveNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to ADLACPActive values", s) +} + +// ADLACPActiveValues returns all values of the enum +func ADLACPActiveValues() []ADLACPActive { + return _ADLACPActiveValues +} + +// ADLACPActiveStrings returns a slice of all String values of the enum +func ADLACPActiveStrings() []string { + strs := make([]string, len(_ADLACPActiveNames)) + copy(strs, _ADLACPActiveNames) + return strs +} + +// IsAADLACPActive returns "true" if the value is listed in the enum definition. "false" otherwise +func (i ADLACPActive) IsAADLACPActive() bool { + for _, v := range _ADLACPActiveValues { + if i == v { + return true + } + } + return false +} + +// MarshalText implements the encoding.TextMarshaler interface for ADLACPActive +func (i ADLACPActive) MarshalText() ([]byte, error) { + return []byte(i.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface for ADLACPActive +func (i *ADLACPActive) UnmarshalText(text []byte) error { + var err error + *i, err = ADLACPActiveString(string(text)) + return err +} + const _AutoHostnameKindName = "offtalos-addrstable" var _AutoHostnameKindIndex = [...]uint8{0, 3, 13, 19} diff --git a/pkg/machinery/nethelpers/arpvalidate.go b/pkg/machinery/nethelpers/arpvalidate.go index 321619b15..8d8044f81 100644 --- a/pkg/machinery/nethelpers/arpvalidate.go +++ b/pkg/machinery/nethelpers/arpvalidate.go @@ -13,10 +13,13 @@ type ARPValidate uint32 // //structprotogen:gen_enum const ( - ARPValidateNone ARPValidate = iota // none - ARPValidateActive // active - ARPValidateBackup // backup - ARPValidateAll // all + ARPValidateNone ARPValidate = iota // none + ARPValidateActive // active + ARPValidateBackup // backup + ARPValidateAll // all + ARPValidateFilter // filter + ARPValidateFilterActive // filter-active + ARPValidateFilterBackup // filter-backup ) // ARPValidateByName parses ARPValidate. @@ -30,6 +33,12 @@ func ARPValidateByName(a string) (ARPValidate, error) { return ARPValidateBackup, nil case "all": return ARPValidateAll, nil + case "filter": + return ARPValidateFilter, nil + case "filter-active": + return ARPValidateFilterActive, nil + case "filter-backup": + return ARPValidateFilterBackup, nil default: return 0, fmt.Errorf("invalid arp_validate mode %v", a) } diff --git a/pkg/machinery/nethelpers/nethelpers.go b/pkg/machinery/nethelpers/nethelpers.go index 1a8375020..b84b23319 100644 --- a/pkg/machinery/nethelpers/nethelpers.go +++ b/pkg/machinery/nethelpers/nethelpers.go @@ -5,5 +5,5 @@ // Package nethelpers provides types and type wrappers to support network resources. package nethelpers -//go:generate go tool github.com/dmarkham/enumer -type=ARPAllTargets,ARPValidate,AddressFlag,AddressSortAlgorithm,ADSelect,AutoHostnameKind,BondMode,BondXmitHashPolicy,ClientIdentifier,ConntrackState,DefaultAction,Duplex,Family,LACPRate,LinkFlag,LinkType,MatchOperator,NfTablesChainHook,NfTablesChainPriority,NfTablesVerdict,OperationalState,Port,PrimaryReselect,Protocol,RouteFlag,RouteProtocol,RouteType,RoutingTable,Scope,Status,VLANProtocol,WOLMode -linecomment -text +//go:generate go tool github.com/dmarkham/enumer -type=ARPAllTargets,ARPValidate,AddressFlag,AddressSortAlgorithm,ADSelect,ADLACPActive,AutoHostnameKind,BondMode,BondXmitHashPolicy,ClientIdentifier,ConntrackState,DefaultAction,Duplex,Family,LACPRate,LinkFlag,LinkType,MatchOperator,NfTablesChainHook,NfTablesChainPriority,NfTablesVerdict,OperationalState,Port,PrimaryReselect,Protocol,RouteFlag,RouteProtocol,RouteType,RoutingTable,Scope,Status,VLANProtocol,WOLMode -linecomment -text //go:generate go tool github.com/dmarkham/enumer -type=FailOverMAC -linecomment diff --git a/pkg/machinery/resources/network/address_spec.go b/pkg/machinery/resources/network/address_spec.go index aca576bca..659ba985b 100644 --- a/pkg/machinery/resources/network/address_spec.go +++ b/pkg/machinery/resources/network/address_spec.go @@ -16,7 +16,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/proto" ) -//go:generate go tool github.com/siderolabs/deep-copy -type AddressSpecSpec -type AddressStatusSpec -type DNSResolveCacheSpec -type EthernetSpecSpec -type EthernetStatusSpec -type HardwareAddrSpec -type HostDNSConfigSpec -type HostnameSpecSpec -type HostnameStatusSpec -type LinkAliasSpecSpec -type LinkRefreshSpec -type LinkSpecSpec -type LinkStatusSpec -type NfTablesChainSpec -type NodeAddressSpec -type NodeAddressSortAlgorithmSpec -type NodeAddressFilterSpec -type OperatorSpecSpec -type PlatformConfigSpec -type ProbeSpecSpec -type ProbeStatusSpec -type ResolverSpecSpec -type ResolverStatusSpec -type RouteSpecSpec -type RouteStatusSpec -type StatusSpec -type TimeServerSpecSpec -type TimeServerStatusSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go . +//go:generate go tool github.com/siderolabs/deep-copy -type AddressSpecSpec -type AddressStatusSpec -type BondMasterSpec -type DNSResolveCacheSpec -type EthernetSpecSpec -type EthernetStatusSpec -type HardwareAddrSpec -type HostDNSConfigSpec -type HostnameSpecSpec -type HostnameStatusSpec -type LinkAliasSpecSpec -type LinkRefreshSpec -type LinkSpecSpec -type LinkStatusSpec -type NfTablesChainSpec -type NodeAddressSpec -type NodeAddressSortAlgorithmSpec -type NodeAddressFilterSpec -type OperatorSpecSpec -type PlatformConfigSpec -type ProbeSpecSpec -type ProbeStatusSpec -type ResolverSpecSpec -type ResolverStatusSpec -type RouteSpecSpec -type RouteStatusSpec -type StatusSpec -type TimeServerSpecSpec -type TimeServerStatusSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go . // AddressSpecType is type of AddressSpec resource. const AddressSpecType = resource.Type("AddressSpecs.net.talos.dev") diff --git a/pkg/machinery/resources/network/deep_copy.generated.go b/pkg/machinery/resources/network/deep_copy.generated.go index 5c56b6cda..b7645114c 100644 --- a/pkg/machinery/resources/network/deep_copy.generated.go +++ b/pkg/machinery/resources/network/deep_copy.generated.go @@ -2,7 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -// Code generated by "deep-copy -type AddressSpecSpec -type AddressStatusSpec -type DNSResolveCacheSpec -type EthernetSpecSpec -type EthernetStatusSpec -type HardwareAddrSpec -type HostDNSConfigSpec -type HostnameSpecSpec -type HostnameStatusSpec -type LinkAliasSpecSpec -type LinkRefreshSpec -type LinkSpecSpec -type LinkStatusSpec -type NfTablesChainSpec -type NodeAddressSpec -type NodeAddressSortAlgorithmSpec -type NodeAddressFilterSpec -type OperatorSpecSpec -type PlatformConfigSpec -type ProbeSpecSpec -type ProbeStatusSpec -type ResolverSpecSpec -type ResolverStatusSpec -type RouteSpecSpec -type RouteStatusSpec -type StatusSpec -type TimeServerSpecSpec -type TimeServerStatusSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT. +// Code generated by "deep-copy -type AddressSpecSpec -type AddressStatusSpec -type BondMasterSpec -type DNSResolveCacheSpec -type EthernetSpecSpec -type EthernetStatusSpec -type HardwareAddrSpec -type HostDNSConfigSpec -type HostnameSpecSpec -type HostnameStatusSpec -type LinkAliasSpecSpec -type LinkRefreshSpec -type LinkSpecSpec -type LinkStatusSpec -type NfTablesChainSpec -type NodeAddressSpec -type NodeAddressSortAlgorithmSpec -type NodeAddressFilterSpec -type OperatorSpecSpec -type PlatformConfigSpec -type ProbeSpecSpec -type ProbeStatusSpec -type ResolverSpecSpec -type ResolverStatusSpec -type RouteSpecSpec -type RouteStatusSpec -type StatusSpec -type TimeServerSpecSpec -type TimeServerStatusSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT. package network @@ -24,6 +24,24 @@ func (o AddressStatusSpec) DeepCopy() AddressStatusSpec { return cp } +// DeepCopy generates a deep copy of BondMasterSpec. +func (o BondMasterSpec) DeepCopy() BondMasterSpec { + var cp BondMasterSpec = o + if o.PrimaryIndex != nil { + cp.PrimaryIndex = new(uint32) + *cp.PrimaryIndex = *o.PrimaryIndex + } + if o.ARPIPTargets != nil { + cp.ARPIPTargets = make([]netip.Addr, len(o.ARPIPTargets)) + copy(cp.ARPIPTargets, o.ARPIPTargets) + } + if o.NSIP6Targets != nil { + cp.NSIP6Targets = make([]netip.Addr, len(o.NSIP6Targets)) + copy(cp.NSIP6Targets, o.NSIP6Targets) + } + return cp +} + // DeepCopy generates a deep copy of DNSResolveCacheSpec. func (o DNSResolveCacheSpec) DeepCopy() DNSResolveCacheSpec { var cp DNSResolveCacheSpec = o @@ -279,6 +297,7 @@ func (o LinkSpecSpec) DeepCopy() LinkSpecSpec { cp.HardwareAddress = make([]byte, len(o.HardwareAddress)) copy(cp.HardwareAddress, o.HardwareAddress) } + cp.BondMaster = o.BondMaster.DeepCopy() if o.Wireguard.Peers != nil { cp.Wireguard.Peers = make([]WireguardPeer, len(o.Wireguard.Peers)) copy(cp.Wireguard.Peers, o.Wireguard.Peers) @@ -311,6 +330,7 @@ func (o LinkStatusSpec) DeepCopy() LinkStatusSpec { cp.BroadcastAddr = make([]byte, len(o.BroadcastAddr)) copy(cp.BroadcastAddr, o.BroadcastAddr) } + cp.BondMaster = o.BondMaster.DeepCopy() if o.Wireguard.Peers != nil { cp.Wireguard.Peers = make([]WireguardPeer, len(o.Wireguard.Peers)) copy(cp.Wireguard.Peers, o.Wireguard.Peers) diff --git a/pkg/machinery/resources/network/link.go b/pkg/machinery/resources/network/link.go index d865f556f..35bf1255a 100644 --- a/pkg/machinery/resources/network/link.go +++ b/pkg/machinery/resources/network/link.go @@ -28,30 +28,236 @@ type VLANSpec struct { // //gotagsrewrite:gen type BondMasterSpec struct { - Mode nethelpers.BondMode `yaml:"mode" protobuf:"1"` - HashPolicy nethelpers.BondXmitHashPolicy `yaml:"xmitHashPolicy" protobuf:"2"` - LACPRate nethelpers.LACPRate `yaml:"lacpRate" protobuf:"3"` - ARPValidate nethelpers.ARPValidate `yaml:"arpValidate" protobuf:"4"` - ARPAllTargets nethelpers.ARPAllTargets `yaml:"arpAllTargets" protobuf:"5"` - PrimaryIndex uint32 `yaml:"primary,omitempty" protobuf:"6"` - PrimaryReselect nethelpers.PrimaryReselect `yaml:"primaryReselect" protobuf:"7"` - FailOverMac nethelpers.FailOverMAC `yaml:"failOverMac" protobuf:"8"` - ADSelect nethelpers.ADSelect `yaml:"adSelect,omitempty" protobuf:"9"` - MIIMon uint32 `yaml:"miimon,omitempty" protobuf:"10"` - UpDelay uint32 `yaml:"updelay,omitempty" protobuf:"11"` - DownDelay uint32 `yaml:"downdelay,omitempty" protobuf:"12"` - ARPInterval uint32 `yaml:"arpInterval,omitempty" protobuf:"13"` - ResendIGMP uint32 `yaml:"resendIgmp,omitempty" protobuf:"14"` - MinLinks uint32 `yaml:"minLinks,omitempty" protobuf:"15"` - LPInterval uint32 `yaml:"lpInterval,omitempty" protobuf:"16"` - PacketsPerSlave uint32 `yaml:"packetsPerSlave,omitempty" protobuf:"17"` - NumPeerNotif uint8 `yaml:"numPeerNotif,omitempty" protobuf:"18"` - TLBDynamicLB uint8 `yaml:"tlbLogicalLb,omitempty" protobuf:"19"` - AllSlavesActive uint8 `yaml:"allSlavesActive,omitempty" protobuf:"20"` - UseCarrier bool `yaml:"useCarrier,omitempty" protobuf:"21"` - ADActorSysPrio uint16 `yaml:"adActorSysPrio,omitempty" protobuf:"22"` - ADUserPortKey uint16 `yaml:"adUserPortKey,omitempty" protobuf:"23"` - PeerNotifyDelay uint32 `yaml:"peerNotifyDelay,omitempty" protobuf:"24"` + // Mode specifies the bonding policy + Mode nethelpers.BondMode `yaml:"mode" protobuf:"1"` + // HashPolicy selects the transmit hash policy to use for slave selection. + HashPolicy nethelpers.BondXmitHashPolicy `yaml:"xmitHashPolicy" protobuf:"2"` + // LACPRate specifies the rate at which LACPDU frames are sent. + LACPRate nethelpers.LACPRate `yaml:"lacpRate" protobuf:"3"` + // ARPValidate specifies whether or not ARP probes and replies should be validated. + ARPValidate nethelpers.ARPValidate `yaml:"arpValidate" protobuf:"4"` + // ARPAllTargets specifies whether ARP probes should be sent to any or all targets. + ARPAllTargets nethelpers.ARPAllTargets `yaml:"arpAllTargets" protobuf:"5"` + // PrimaryIndex is a device index specifying which slave is the primary device. + PrimaryIndex *uint32 `yaml:"primary,omitempty" protobuf:"6"` + // PrimaryReselect specifies the policy under which the primary slave should be reselected. + PrimaryReselect nethelpers.PrimaryReselect `yaml:"primaryReselect" protobuf:"7"` + // FailOverMac whether active-backup mode should set all slaves to the same MAC address at enslavement, when enabled, or perform special handling. + FailOverMac nethelpers.FailOverMAC `yaml:"failOverMac" protobuf:"8"` + // ADSelect specifies the aggregate selection policy for 802.3ad. + ADSelect nethelpers.ADSelect `yaml:"adSelect,omitempty" protobuf:"9"` + // MIIMon is the link monitoring frequency in milliseconds. + MIIMon uint32 `yaml:"miimon,omitempty" protobuf:"10"` + // UpDelay is the time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. + UpDelay uint32 `yaml:"updelay,omitempty" protobuf:"11"` + // DownDelay is the time, in milliseconds, to wait before disabling a slave after a link failure has been detected. + DownDelay uint32 `yaml:"downdelay,omitempty" protobuf:"12"` + // ARPInterval is the ARP link monitoring frequency in milliseconds. + ARPInterval uint32 `yaml:"arpInterval,omitempty" protobuf:"13"` + // ResendIGMP specifies the number of times IGMP packets should be resent. + ResendIGMP uint32 `yaml:"resendIgmp,omitempty" protobuf:"14"` + // MinLinks specifies the minimum number of active links to assert carrier. + MinLinks uint32 `yaml:"minLinks,omitempty" protobuf:"15"` + // LPInterval specifies the number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch. + LPInterval uint32 `yaml:"lpInterval,omitempty" protobuf:"16"` + // PacketsPerSlave specifies the number of packets to transmit through a slave before moving to the next one. + PacketsPerSlave uint32 `yaml:"packetsPerSlave,omitempty" protobuf:"17"` + // NumPeerNotif specifies the number of peer notifications + // (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements) to be issued after a failover event. + NumPeerNotif uint8 `yaml:"numPeerNotif,omitempty" protobuf:"18"` + // TLBDynamicLB specifies if dynamic shuffling of flows is enabled in tlb or alb mode. + TLBDynamicLB uint8 `yaml:"tlbLogicalLb,omitempty" protobuf:"19"` + // AllSlavesActive specifies that duplicate frames (received on inactive ports) should be dropped (0) or delivered (1). + AllSlavesActive uint8 `yaml:"allSlavesActive,omitempty" protobuf:"20"` + // UseCarrier specifies whether or not miimon should use MII or ETHTOOL. + UseCarrier bool `yaml:"useCarrier,omitempty" protobuf:"21"` + // ADActorSysPrio is the actor system priority for 802.3ad. + ADActorSysPrio uint16 `yaml:"adActorSysPrio,omitempty" protobuf:"22"` + // ADUserPortKey is the user port key (upper 10 bits) for 802.3ad. + ADUserPortKey uint16 `yaml:"adUserPortKey,omitempty" protobuf:"23"` + // PeerNotifyDelay is the delay, in milliseconds, between each peer notification. + PeerNotifyDelay uint32 `yaml:"peerNotifyDelay,omitempty" protobuf:"24"` + // ARPIPTargets is the list of IP addresses to use for ARP link monitoring when ARPInterval is set. + // + // Maximum of 16 targets are supported. + ARPIPTargets []netip.Addr `yaml:"arpIpTargets,omitempty" protobuf:"25"` + // NSIP6Targets is the list of IPv6 addresses to use for NS link monitoring when ARPInterval is set. + // + // Maximum of 16 targets are supported. + NSIP6Targets []netip.Addr `yaml:"nsIp6Targets,omitempty" protobuf:"26"` + // ADLACPActive specifies whether to send LACPDU frames periodically. + ADLACPActive nethelpers.ADLACPActive `yaml:"adLacpActive,omitempty" protobuf:"27"` + // MissedMax is the number of arp_interval monitor checks that must fail in order for an interface to be marked down by the ARP monitor. + MissedMax uint8 `yaml:"missedMax,omitempty" protobuf:"28"` +} + +// Equal checks two BondMasterSpecs for equality. +// +//nolint:gocyclo,cyclop +func (spec *BondMasterSpec) Equal(other *BondMasterSpec) bool { + if spec.Mode != other.Mode { + return false + } + + if spec.HashPolicy != other.HashPolicy { + return false + } + + if spec.LACPRate != other.LACPRate { + return false + } + + if spec.ARPValidate != other.ARPValidate { + return false + } + + if spec.ARPAllTargets != other.ARPAllTargets { + return false + } + + if (spec.PrimaryIndex == nil) != (other.PrimaryIndex == nil) { + return false + } + + if spec.PrimaryIndex != nil && other.PrimaryIndex != nil && *spec.PrimaryIndex != *other.PrimaryIndex { + return false + } + + if spec.PrimaryReselect != other.PrimaryReselect { + return false + } + + if spec.FailOverMac != other.FailOverMac { + return false + } + + if spec.ADSelect != other.ADSelect { + return false + } + + if spec.MIIMon != other.MIIMon { + return false + } + + if spec.UpDelay != other.UpDelay { + return false + } + + if spec.DownDelay != other.DownDelay { + return false + } + + if spec.ARPInterval != other.ARPInterval { + return false + } + + if spec.ResendIGMP != other.ResendIGMP { + return false + } + + if spec.MinLinks != other.MinLinks { + return false + } + + if spec.LPInterval != other.LPInterval { + return false + } + + if spec.PacketsPerSlave != other.PacketsPerSlave { + return false + } + + if spec.NumPeerNotif != other.NumPeerNotif { + return false + } + + if spec.TLBDynamicLB != other.TLBDynamicLB { + return false + } + + if spec.AllSlavesActive != other.AllSlavesActive { + return false + } + + if spec.UseCarrier != other.UseCarrier { + return false + } + + if spec.ADActorSysPrio != other.ADActorSysPrio { + return false + } + + if spec.ADUserPortKey != other.ADUserPortKey { + return false + } + + if spec.PeerNotifyDelay != other.PeerNotifyDelay { + return false + } + + if len(spec.ARPIPTargets) != len(other.ARPIPTargets) { + return false + } + + for i := range spec.ARPIPTargets { + if spec.ARPIPTargets[i] != other.ARPIPTargets[i] { + return false + } + } + + if len(spec.NSIP6Targets) != len(other.NSIP6Targets) { + return false + } + + for i := range spec.NSIP6Targets { + if spec.NSIP6Targets[i] != other.NSIP6Targets[i] { + return false + } + } + + if spec.ADLACPActive != other.ADLACPActive { + return false + } + + if spec.MissedMax != other.MissedMax { + return false + } + + return true +} + +// IsZero checks if the BondMasterSpec is zero value. +// +//nolint:gocyclo,cyclop +func (spec *BondMasterSpec) IsZero() bool { + return spec.Mode == 0 && + spec.HashPolicy == 0 && + spec.LACPRate == 0 && + spec.ARPValidate == 0 && + spec.ARPAllTargets == 0 && + spec.PrimaryIndex == nil && + spec.PrimaryReselect == 0 && + spec.FailOverMac == 0 && + spec.ADSelect == 0 && + spec.MIIMon == 0 && + spec.UpDelay == 0 && + spec.DownDelay == 0 && + spec.ARPInterval == 0 && + spec.ResendIGMP == 0 && + spec.MinLinks == 0 && + spec.LPInterval == 0 && + spec.PacketsPerSlave == 0 && + spec.NumPeerNotif == 0 && + spec.TLBDynamicLB == 0 && + spec.AllSlavesActive == 0 && + !spec.UseCarrier && + spec.ADActorSysPrio == 0 && + spec.ADUserPortKey == 0 && + spec.PeerNotifyDelay == 0 && + len(spec.ARPIPTargets) == 0 && + len(spec.NSIP6Targets) == 0 && + spec.ADLACPActive == 0 && + spec.MissedMax == 0 } // BridgeMasterSpec describes bridge settings if Kind == "bridge". diff --git a/pkg/machinery/resources/network/link_spec.go b/pkg/machinery/resources/network/link_spec.go index 513c18c98..f3eec9dcc 100644 --- a/pkg/machinery/resources/network/link_spec.go +++ b/pkg/machinery/resources/network/link_spec.go @@ -96,10 +96,13 @@ func (spec *LinkSpecSpec) Merge(other *LinkSpecSpec) error { updateIfNotZero(&spec.ParentName, other.ParentName) updateIfNotZero(&spec.BondSlave, other.BondSlave) updateIfNotZero(&spec.VLAN, other.VLAN) - updateIfNotZero(&spec.BondMaster, other.BondMaster) updateIfNotZero(&spec.BridgeMaster, other.BridgeMaster) updateIfNotZero(&spec.BridgeSlave, other.BridgeSlave) + if !other.BondMaster.IsZero() { + spec.BondMaster = other.BondMaster.DeepCopy() + } + if other.HardwareAddress != nil { spec.HardwareAddress = slices.Clone(other.HardwareAddress) } diff --git a/pkg/machinery/resources/network/link_spec_test.go b/pkg/machinery/resources/network/link_spec_test.go index be48891c5..6f7b539a4 100644 --- a/pkg/machinery/resources/network/link_spec_test.go +++ b/pkg/machinery/resources/network/link_spec_test.go @@ -2,6 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +//nolint:dupl package network_test import ( @@ -9,6 +10,7 @@ import ( "testing" "time" + "github.com/siderolabs/go-pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.yaml.in/yaml/v4" @@ -40,7 +42,7 @@ func TestLinkSpecMarshalYAML(t *testing.T) { LACPRate: nethelpers.LACPRateFast, ARPValidate: nethelpers.ARPValidateAll, ARPAllTargets: nethelpers.ARPAllTargetsAny, - PrimaryIndex: 3, + PrimaryIndex: pointer.To[uint32](3), PrimaryReselect: nethelpers.PrimaryReselectBetter, FailOverMac: nethelpers.FailOverMACFollow, ADSelect: nethelpers.ADSelectCount, diff --git a/pkg/machinery/resources/network/link_status_test.go b/pkg/machinery/resources/network/link_status_test.go index 7e37658b8..7c7a05335 100644 --- a/pkg/machinery/resources/network/link_status_test.go +++ b/pkg/machinery/resources/network/link_status_test.go @@ -2,6 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +//nolint:dupl package network_test import ( @@ -11,6 +12,7 @@ import ( "time" "github.com/mdlayher/ethtool" + "github.com/siderolabs/go-pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.yaml.in/yaml/v4" @@ -63,7 +65,7 @@ func TestLinkStatusMarshalYAML(t *testing.T) { LACPRate: nethelpers.LACPRateFast, ARPValidate: nethelpers.ARPValidateAll, ARPAllTargets: nethelpers.ARPAllTargetsAny, - PrimaryIndex: 3, + PrimaryIndex: pointer.To[uint32](3), PrimaryReselect: nethelpers.PrimaryReselectBetter, FailOverMac: nethelpers.FailOverMACFollow, ADSelect: nethelpers.ADSelectCount, diff --git a/website/content/v1.12/reference/api.md b/website/content/v1.12/reference/api.md index bc5f5d49a..d28cec978 100644 --- a/website/content/v1.12/reference/api.md +++ b/website/content/v1.12/reference/api.md @@ -259,6 +259,7 @@ description: Talos gRPC API reference. - [CriImageCacheStatus](#talos.resource.definitions.enums.CriImageCacheStatus) - [KubespanPeerState](#talos.resource.definitions.enums.KubespanPeerState) - [MachineType](#talos.resource.definitions.enums.MachineType) + - [NethelpersADLACPActive](#talos.resource.definitions.enums.NethelpersADLACPActive) - [NethelpersADSelect](#talos.resource.definitions.enums.NethelpersADSelect) - [NethelpersARPAllTargets](#talos.resource.definitions.enums.NethelpersARPAllTargets) - [NethelpersARPValidate](#talos.resource.definitions.enums.NethelpersARPValidate) @@ -4597,6 +4598,18 @@ MachineType represents a machine type. + + +### NethelpersADLACPActive +NethelpersADLACPActive is ADLACPActive. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| ADLACP_ACTIVE_OFF | 0 | | +| ADLACP_ACTIVE_ON | 1 | | + + + ### NethelpersADSelect @@ -4633,6 +4646,9 @@ NethelpersARPValidate is an ARP Validation mode. | ARP_VALIDATE_ACTIVE | 1 | | | ARP_VALIDATE_BACKUP | 2 | | | ARP_VALIDATE_ALL | 3 | | +| ARP_VALIDATE_FILTER | 4 | | +| ARP_VALIDATE_FILTER_ACTIVE | 5 | | +| ARP_VALIDATE_FILTER_BACKUP | 6 | | @@ -8337,6 +8353,10 @@ BondMasterSpec describes bond settings if Kind == "bond". | ad_actor_sys_prio | [uint32](#uint32) | | | | ad_user_port_key | [uint32](#uint32) | | | | peer_notify_delay | [uint32](#uint32) | | | +| arpip_targets | [common.NetIP](#common.NetIP) | repeated | | +| nsip6_targets | [common.NetIP](#common.NetIP) | repeated | | +| adlacp_active | [talos.resource.definitions.enums.NethelpersADLACPActive](#talos.resource.definitions.enums.NethelpersADLACPActive) | | | +| missed_max | [uint32](#uint32) | | | diff --git a/website/content/v1.12/reference/configuration/network/bondconfig.md b/website/content/v1.12/reference/configuration/network/bondconfig.md new file mode 100644 index 000000000..b43d85959 --- /dev/null +++ b/website/content/v1.12/reference/configuration/network/bondconfig.md @@ -0,0 +1,213 @@ +--- +description: BondConfig is a config document to create a bond (link aggregation) over a set of links. +title: BondConfig +--- + + + + + + + + + + + +{{< highlight yaml >}} +apiVersion: v1alpha1 +kind: BondConfig +name: bond.int # Name of the bond link (interface) to be created. +# Names of the links (interfaces) on which the bond will be created. +links: + - enp1s2 + - enp1s2 +bondMode: 802.3ad # Bond mode. +miimon: 100 # Link monitoring frequency in milliseconds. +updelay: 200 # The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. +downdelay: 200 # The time, in milliseconds, to wait before disabling a slave after a link failure has been detected. +xmitHashPolicy: layer3+4 # Selects the transmit hash policy to use for slave selection. +lacpRate: slow # LACPDU frames periodic transmission rate. +adActorSysPrio: 65535 # Actor system priority for 802.3ad. +resendIGMP: 1 # The number of times IGMP packets should be resent. +packetsPerSlave: 1 # The number of packets to transmit through a slave before moving to the next one. +# Configure addresses to be statically assigned to the link. +addresses: + - address: 10.15.0.3/16 # IP address to be assigned to the link. +# Configure routes to be statically created via the link. +routes: + - destination: 10.0.0.0/8 # The route's destination as an address prefix. + gateway: 10.15.0.1 # The route's gateway (if empty, creates link scope route). + +# # Override the hardware (MAC) address of the link. +# hardwareAddr: 2e:3c:4d:5e:6f:70 + +# # ARP link monitoring frequency in milliseconds. +# arpInterval: 1000 + +# # The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set. +# arpIpTargets: +# - 10.15.0.1 + +# # The list of IPv6 addresses to use for NS link monitoring when arpInterval is set. +# nsIp6Targets: +# - fd00::1 + +# # Specifies whether or not ARP probes and replies should be validated. +# arpValidate: active + +# # Specifies whether ARP probes should be sent to any or all targets. +# arpAllTargets: all + +# # Specifies whether active-backup mode should set all slaves to the same MAC address +# failOverMac: active + +# # Aggregate selection policy for 802.3ad. +# adSelect: stable + +# # Whether to send LACPDU frames periodically. +# adLACPActive: on + +# # Policy under which the primary slave should be reselected. +# primaryReselect: always + +# # Whether dynamic shuffling of flows is enabled in tlb or alb mode. +# tlbLogicalLb: 1 +{{< /highlight >}} + + +| Field | Type | Description | Value(s) | +|-------|------|-------------|----------| +|`name` |string |Name of the bond link (interface) to be created.
Show example(s){{< highlight yaml >}} +name: bond.ext +{{< /highlight >}}
| | +|`hardwareAddr` |HardwareAddr |Override the hardware (MAC) address of the link.
Show example(s){{< highlight yaml >}} +hardwareAddr: 2e:3c:4d:5e:6f:70 +{{< /highlight >}}
| | +|`links` |[]string |Names of the links (interfaces) on which the bond will be created.
Link aliases can be used here as well.
Show example(s){{< highlight yaml >}} +links: + - enp0s3 + - enp0s8 +{{< /highlight >}}
| | +|`bondMode` |BondMode |Bond mode.
Show example(s){{< highlight yaml >}} +bondMode: 802.3ad +{{< /highlight >}}
|`balance-rr`
`active-backup`
`balance-xor`
`broadcast`
`802.3ad`
`balance-tlb`
`balance-alb`
| +|`miimon` |uint32 |Link monitoring frequency in milliseconds.
Show example(s){{< highlight yaml >}} +miimon: 200 +{{< /highlight >}}
| | +|`updelay` |uint32 |The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.
Show example(s){{< highlight yaml >}} +updelay: 300 +{{< /highlight >}}
| | +|`downdelay` |uint32 |The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.
Show example(s){{< highlight yaml >}} +downdelay: 100 +{{< /highlight >}}
| | +|`useCarrier` |bool |Specifies whether or not miimon should use MII or ETHTOOL. | | +|`xmitHashPolicy` |BondXmitHashPolicy |Selects the transmit hash policy to use for slave selection.
Show example(s){{< highlight yaml >}} +xmitHashPolicy: layer2 +{{< /highlight >}}
|`layer2`
`layer3+4`
`layer2+3`
`encap2+3`
`encap3+4`
| +|`arpInterval` |uint32 |ARP link monitoring frequency in milliseconds.
Show example(s){{< highlight yaml >}} +arpInterval: 1000 +{{< /highlight >}}
| | +|`arpIpTargets` |[]Addr |The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.
Maximum of 16 targets are supported.
Show example(s){{< highlight yaml >}} +arpIpTargets: + - 10.15.0.1 +{{< /highlight >}}
| | +|`nsIp6Targets` |[]Addr |The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.
Maximum of 16 targets are supported.
Show example(s){{< highlight yaml >}} +nsIp6Targets: + - fd00::1 +{{< /highlight >}}
| | +|`arpValidate` |ARPValidate |Specifies whether or not ARP probes and replies should be validated.
Show example(s){{< highlight yaml >}} +arpValidate: active +{{< /highlight >}}
|`none`
`active`
`backup`
`all`
`filter`
`filter-active`
`filter-backup`
| +|`arpAllTargets` |ARPAllTargets |Specifies whether ARP probes should be sent to any or all targets.
Show example(s){{< highlight yaml >}} +arpAllTargets: all +{{< /highlight >}}
|`any`
`all`
| +|`lacpRate` |LACPRate |LACPDU frames periodic transmission rate.
Show example(s){{< highlight yaml >}} +lacpRate: fast +{{< /highlight >}}
|`slow`
`fast`
| +|`failOverMac` |FailOverMAC |Specifies whether active-backup mode should set all slaves to the same MAC address
at enslavement, when enabled, or perform special handling.
Show example(s){{< highlight yaml >}} +failOverMac: active +{{< /highlight >}}
|`none`
`active`
`follow`
| +|`adSelect` |ADSelect |Aggregate selection policy for 802.3ad.
Show example(s){{< highlight yaml >}} +adSelect: stable +{{< /highlight >}}
|`stable`
`bandwidth`
`count`
| +|`adActorSysPrio` |uint16 |Actor system priority for 802.3ad.
Show example(s){{< highlight yaml >}} +adActorSysPrio: 65535 +{{< /highlight >}}
| | +|`adUserPortKey` |uint16 |User port key (upper 10 bits) for 802.3ad.
Show example(s){{< highlight yaml >}} +adUserPortKey: 0 +{{< /highlight >}}
| | +|`adLACPActive` |ADLACPActive |Whether to send LACPDU frames periodically.
Show example(s){{< highlight yaml >}} +adLACPActive: on +{{< /highlight >}}
|`on`
`off`
| +|`primaryReselect` |PrimaryReselect |Policy under which the primary slave should be reselected.
Show example(s){{< highlight yaml >}} +primaryReselect: always +{{< /highlight >}}
|`always`
`better`
`failure`
| +|`resendIGMP` |uint32 |The number of times IGMP packets should be resent. | | +|`minLinks` |uint32 |The minimum number of active links required for the bond to be considered active. | | +|`lpInterval` |uint32 |The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch. | | +|`packetsPerSlave` |uint32 |The number of packets to transmit through a slave before moving to the next one. | | +|`numPeerNotif` |uint8 |The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)
to be issued after a failover event. | | +|`tlbLogicalLb` |uint8 |Whether dynamic shuffling of flows is enabled in tlb or alb mode.
Show example(s){{< highlight yaml >}} +tlbLogicalLb: 1 +{{< /highlight >}}
| | +|`allSlavesActive` |uint8 |Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).
Show example(s){{< highlight yaml >}} +allSlavesActive: 0 +{{< /highlight >}}
| | +|`peerNotifDelay` |uint32 |The delay, in milliseconds, between each peer notification. | | +|`missedMax` |uint8 |The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor. | | +|`up` |bool |Bring the link up or down.

If not specified, the link will be brought up. | | +|`mtu` |uint32 |Configure LinkMTU (Maximum Transmission Unit) for the link.

If not specified, the system default LinkMTU will be used (usually 1500). | | +|`addresses` |[]AddressConfig |Configure addresses to be statically assigned to the link. | | +|`routes` |[]RouteConfig |Configure routes to be statically created via the link. | | + + + + +## addresses[] {#BondConfig.addresses.} + +AddressConfig represents a network address configuration. + + + + +| Field | Type | Description | Value(s) | +|-------|------|-------------|----------| +|`address` |Prefix |IP address to be assigned to the link.

This field must include the network prefix length (e.g. /24 for IPv4, /64 for IPv6).
Show example(s){{< highlight yaml >}} +address: 192.168.1.100/24 +{{< /highlight >}}{{< highlight yaml >}} +address: fd00::1/64 +{{< /highlight >}}
| | +|`routePriority` |uint32 |Configure the route priority (metric) for routes created for this address.

If not specified, the system default route priority will be used. | | + + + + + + +## routes[] {#BondConfig.routes.} + +RouteConfig represents a network route configuration. + + + + +| Field | Type | Description | Value(s) | +|-------|------|-------------|----------| +|`destination` |Prefix |The route's destination as an address prefix.

If not specified, a default route will be created for the address family of the gateway.
Show example(s){{< highlight yaml >}} +destination: 10.0.0.0/8 +{{< /highlight >}}
| | +|`gateway` |Addr |The route's gateway (if empty, creates link scope route).
Show example(s){{< highlight yaml >}} +gateway: 10.0.0.1 +{{< /highlight >}}
| | +|`source` |Addr |The route's source address (optional). | | +|`metric` |uint32 |The optional metric for the route. | | +|`mtu` |uint32 |The optional MTU for the route. | | +|`table` |RoutingTable |The routing table to use for the route.

If not specified, the main routing table will be used. | | + + + + + + + + diff --git a/website/content/v1.12/reference/configuration/network/vlanconfig.md b/website/content/v1.12/reference/configuration/network/vlanconfig.md index ca3ce24fa..07900d6fb 100644 --- a/website/content/v1.12/reference/configuration/network/vlanconfig.md +++ b/website/content/v1.12/reference/configuration/network/vlanconfig.md @@ -43,7 +43,7 @@ vlanID: 34 |`vlanMode` |VLANProtocol |Set the VLAN mode to use.
If not set, defaults to '802.1q'.
Show example(s){{< highlight yaml >}} vlanMode: 802.1q {{< /highlight >}}
|`802.1q`
`802.1ad`
| -|`parent` |string |Name of the parent link (interface) on which the VLAN link will be created.
Show example(s){{< highlight yaml >}} +|`parent` |string |Name of the parent link (interface) on which the VLAN link will be created.
Link aliases can be used here as well.
Show example(s){{< highlight yaml >}} parent: enp0s3 {{< /highlight >}}
| | |`up` |bool |Bring the link up or down.

If not specified, the link will be brought up. | | diff --git a/website/content/v1.12/schemas/config.schema.json b/website/content/v1.12/schemas/config.schema.json index 6527bd32d..3d94f34e9 100644 --- a/website/content/v1.12/schemas/config.schema.json +++ b/website/content/v1.12/schemas/config.schema.json @@ -758,6 +758,337 @@ ], "description": "AddressConfig represents a network address configuration." }, + "network.BondConfigV1Alpha1": { + "properties": { + "apiVersion": { + "enum": [ + "v1alpha1" + ], + "title": "apiVersion", + "description": "apiVersion is the API version of the resource.\n", + "markdownDescription": "apiVersion is the API version of the resource.", + "x-intellij-html-description": "\u003cp\u003eapiVersion is the API version of the resource.\u003c/p\u003e\n" + }, + "kind": { + "enum": [ + "BondConfig" + ], + "title": "kind", + "description": "kind is the kind of the resource.\n", + "markdownDescription": "kind is the kind of the resource.", + "x-intellij-html-description": "\u003cp\u003ekind is the kind of the resource.\u003c/p\u003e\n" + }, + "name": { + "type": "string", + "title": "name", + "description": "Name of the bond link (interface) to be created.\n", + "markdownDescription": "Name of the bond link (interface) to be created.", + "x-intellij-html-description": "\u003cp\u003eName of the bond link (interface) to be created.\u003c/p\u003e\n" + }, + "hardwareAddr": { + "type": "string", + "pattern": "^[0-9a-f:]+$", + "title": "hardwareAddr", + "description": "Override the hardware (MAC) address of the link.\n", + "markdownDescription": "Override the hardware (MAC) address of the link.", + "x-intellij-html-description": "\u003cp\u003eOverride the hardware (MAC) address of the link.\u003c/p\u003e\n" + }, + "links": { + "items": { + "type": "string" + }, + "type": "array", + "title": "links", + "description": "Names of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.\n", + "markdownDescription": "Names of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.", + "x-intellij-html-description": "\u003cp\u003eNames of the links (interfaces) on which the bond will be created.\nLink aliases can be used here as well.\u003c/p\u003e\n" + }, + "bondMode": { + "enum": [ + "balance-rr", + "active-backup", + "balance-xor", + "broadcast", + "802.3ad", + "balance-tlb", + "balance-alb" + ], + "title": "bondMode", + "description": "Bond mode.\n", + "markdownDescription": "Bond mode.", + "x-intellij-html-description": "\u003cp\u003eBond mode.\u003c/p\u003e\n" + }, + "miimon": { + "type": "integer", + "title": "miimon", + "description": "Link monitoring frequency in milliseconds.\n", + "markdownDescription": "Link monitoring frequency in milliseconds.", + "x-intellij-html-description": "\u003cp\u003eLink monitoring frequency in milliseconds.\u003c/p\u003e\n" + }, + "updelay": { + "type": "integer", + "title": "updelay", + "description": "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.\n", + "markdownDescription": "The time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.", + "x-intellij-html-description": "\u003cp\u003eThe time, in milliseconds, to wait before enabling a slave after a link recovery has been detected.\u003c/p\u003e\n" + }, + "downdelay": { + "type": "integer", + "title": "downdelay", + "description": "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.\n", + "markdownDescription": "The time, in milliseconds, to wait before disabling a slave after a link failure has been detected.", + "x-intellij-html-description": "\u003cp\u003eThe time, in milliseconds, to wait before disabling a slave after a link failure has been detected.\u003c/p\u003e\n" + }, + "useCarrier": { + "type": "boolean", + "title": "useCarrier", + "description": "Specifies whether or not miimon should use MII or ETHTOOL.\n", + "markdownDescription": "Specifies whether or not miimon should use MII or ETHTOOL.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether or not miimon should use MII or ETHTOOL.\u003c/p\u003e\n" + }, + "xmitHashPolicy": { + "enum": [ + "layer2", + "layer3+4", + "layer2+3", + "encap2+3", + "encap3+4" + ], + "title": "xmitHashPolicy", + "description": "Selects the transmit hash policy to use for slave selection.\n", + "markdownDescription": "Selects the transmit hash policy to use for slave selection.", + "x-intellij-html-description": "\u003cp\u003eSelects the transmit hash policy to use for slave selection.\u003c/p\u003e\n" + }, + "arpInterval": { + "type": "integer", + "title": "arpInterval", + "description": "ARP link monitoring frequency in milliseconds.\n", + "markdownDescription": "ARP link monitoring frequency in milliseconds.", + "x-intellij-html-description": "\u003cp\u003eARP link monitoring frequency in milliseconds.\u003c/p\u003e\n" + }, + "arpIpTargets": { + "items": { + "type": "string", + "pattern": "^[0-9a-f.:]+$" + }, + "type": "array", + "title": "arpIpTargets", + "description": "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\n", + "markdownDescription": "The list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + "x-intellij-html-description": "\u003cp\u003eThe list of IPv4 addresses to use for ARP link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\u003c/p\u003e\n" + }, + "nsIp6Targets": { + "items": { + "type": "string", + "pattern": "^[0-9a-f.:]+$" + }, + "type": "array", + "title": "nsIp6Targets", + "description": "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\n", + "markdownDescription": "The list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.", + "x-intellij-html-description": "\u003cp\u003eThe list of IPv6 addresses to use for NS link monitoring when arpInterval is set.\nMaximum of 16 targets are supported.\u003c/p\u003e\n" + }, + "arpValidate": { + "enum": [ + "none", + "active", + "backup", + "all", + "filter", + "filter-active", + "filter-backup" + ], + "title": "arpValidate", + "description": "Specifies whether or not ARP probes and replies should be validated.\n", + "markdownDescription": "Specifies whether or not ARP probes and replies should be validated.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether or not ARP probes and replies should be validated.\u003c/p\u003e\n" + }, + "arpAllTargets": { + "enum": [ + "any", + "all" + ], + "title": "arpAllTargets", + "description": "Specifies whether ARP probes should be sent to any or all targets.\n", + "markdownDescription": "Specifies whether ARP probes should be sent to any or all targets.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether ARP probes should be sent to any or all targets.\u003c/p\u003e\n" + }, + "lacpRate": { + "enum": [ + "slow", + "fast" + ], + "title": "lacpRate", + "description": "LACPDU frames periodic transmission rate.\n", + "markdownDescription": "LACPDU frames periodic transmission rate.", + "x-intellij-html-description": "\u003cp\u003eLACPDU frames periodic transmission rate.\u003c/p\u003e\n" + }, + "failOverMac": { + "enum": [ + "none", + "active", + "follow" + ], + "title": "failOverMac", + "description": "Specifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.\n", + "markdownDescription": "Specifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.", + "x-intellij-html-description": "\u003cp\u003eSpecifies whether active-backup mode should set all slaves to the same MAC address\nat enslavement, when enabled, or perform special handling.\u003c/p\u003e\n" + }, + "adSelect": { + "enum": [ + "stable", + "bandwidth", + "count" + ], + "title": "adSelect", + "description": "Aggregate selection policy for 802.3ad.\n", + "markdownDescription": "Aggregate selection policy for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eAggregate selection policy for 802.3ad.\u003c/p\u003e\n" + }, + "adActorSysPrio": { + "type": "integer", + "title": "adActorSysPrio", + "description": "Actor system priority for 802.3ad.\n", + "markdownDescription": "Actor system priority for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eActor system priority for 802.3ad.\u003c/p\u003e\n" + }, + "adUserPortKey": { + "type": "integer", + "title": "adUserPortKey", + "description": "User port key (upper 10 bits) for 802.3ad.\n", + "markdownDescription": "User port key (upper 10 bits) for 802.3ad.", + "x-intellij-html-description": "\u003cp\u003eUser port key (upper 10 bits) for 802.3ad.\u003c/p\u003e\n" + }, + "adLACPActive": { + "enum": [ + "on", + "off" + ], + "title": "adLACPActive", + "description": "Whether to send LACPDU frames periodically.\n", + "markdownDescription": "Whether to send LACPDU frames periodically.", + "x-intellij-html-description": "\u003cp\u003eWhether to send LACPDU frames periodically.\u003c/p\u003e\n" + }, + "primaryReselect": { + "enum": [ + "always", + "better", + "failure" + ], + "title": "primaryReselect", + "description": "Policy under which the primary slave should be reselected.\n", + "markdownDescription": "Policy under which the primary slave should be reselected.", + "x-intellij-html-description": "\u003cp\u003ePolicy under which the primary slave should be reselected.\u003c/p\u003e\n" + }, + "resendIGMP": { + "type": "integer", + "title": "resendIGMP", + "description": "The number of times IGMP packets should be resent.\n", + "markdownDescription": "The number of times IGMP packets should be resent.", + "x-intellij-html-description": "\u003cp\u003eThe number of times IGMP packets should be resent.\u003c/p\u003e\n" + }, + "minLinks": { + "type": "integer", + "title": "minLinks", + "description": "The minimum number of active links required for the bond to be considered active.\n", + "markdownDescription": "The minimum number of active links required for the bond to be considered active.", + "x-intellij-html-description": "\u003cp\u003eThe minimum number of active links required for the bond to be considered active.\u003c/p\u003e\n" + }, + "lpInterval": { + "type": "integer", + "title": "lpInterval", + "description": "The number of seconds between instances where the bonding driver sends learning packets to each slave’s peer switch.\n", + "markdownDescription": "The number of seconds between instances where the bonding driver sends learning packets to each slave's peer switch.", + "x-intellij-html-description": "\u003cp\u003eThe number of seconds between instances where the bonding driver sends learning packets to each slave\u0026rsquo;s peer switch.\u003c/p\u003e\n" + }, + "packetsPerSlave": { + "type": "integer", + "title": "packetsPerSlave", + "description": "The number of packets to transmit through a slave before moving to the next one.\n", + "markdownDescription": "The number of packets to transmit through a slave before moving to the next one.", + "x-intellij-html-description": "\u003cp\u003eThe number of packets to transmit through a slave before moving to the next one.\u003c/p\u003e\n" + }, + "numPeerNotif": { + "type": "integer", + "title": "numPeerNotif", + "description": "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.\n", + "markdownDescription": "The number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.", + "x-intellij-html-description": "\u003cp\u003eThe number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements)\nto be issued after a failover event.\u003c/p\u003e\n" + }, + "tlbLogicalLb": { + "type": "integer", + "title": "tlbLogicalLb", + "description": "Whether dynamic shuffling of flows is enabled in tlb or alb mode.\n", + "markdownDescription": "Whether dynamic shuffling of flows is enabled in tlb or alb mode.", + "x-intellij-html-description": "\u003cp\u003eWhether dynamic shuffling of flows is enabled in tlb or alb mode.\u003c/p\u003e\n" + }, + "allSlavesActive": { + "type": "integer", + "title": "allSlavesActive", + "description": "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).\n", + "markdownDescription": "Whether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).", + "x-intellij-html-description": "\u003cp\u003eWhether duplicate frames (received on inactive ports) should be dropped (0) or delivered (1).\u003c/p\u003e\n" + }, + "peerNotifDelay": { + "type": "integer", + "title": "peerNotifDelay", + "description": "The delay, in milliseconds, between each peer notification.\n", + "markdownDescription": "The delay, in milliseconds, between each peer notification.", + "x-intellij-html-description": "\u003cp\u003eThe delay, in milliseconds, between each peer notification.\u003c/p\u003e\n" + }, + "missedMax": { + "type": "integer", + "title": "missedMax", + "description": "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.\n", + "markdownDescription": "The number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.", + "x-intellij-html-description": "\u003cp\u003eThe number of arpInterval monitor checks that must fail in order for an interface to be marked down by the ARP monitor.\u003c/p\u003e\n" + }, + "up": { + "type": "boolean", + "title": "up", + "description": "Bring the link up or down.\n\nIf not specified, the link will be brought up.\n", + "markdownDescription": "Bring the link up or down.\n\nIf not specified, the link will be brought up.", + "x-intellij-html-description": "\u003cp\u003eBring the link up or down.\u003c/p\u003e\n\n\u003cp\u003eIf not specified, the link will be brought up.\u003c/p\u003e\n" + }, + "mtu": { + "type": "integer", + "title": "mtu", + "description": "Configure LinkMTU (Maximum Transmission Unit) for the link.\n\nIf not specified, the system default LinkMTU will be used (usually 1500).\n", + "markdownDescription": "Configure LinkMTU (Maximum Transmission Unit) for the link.\n\nIf not specified, the system default LinkMTU will be used (usually 1500).", + "x-intellij-html-description": "\u003cp\u003eConfigure LinkMTU (Maximum Transmission Unit) for the link.\u003c/p\u003e\n\n\u003cp\u003eIf not specified, the system default LinkMTU will be used (usually 1500).\u003c/p\u003e\n" + }, + "addresses": { + "items": { + "$ref": "#/$defs/network.AddressConfig" + }, + "type": "array", + "title": "addresses", + "description": "Configure addresses to be statically assigned to the link.\n", + "markdownDescription": "Configure addresses to be statically assigned to the link.", + "x-intellij-html-description": "\u003cp\u003eConfigure addresses to be statically assigned to the link.\u003c/p\u003e\n" + }, + "routes": { + "items": { + "$ref": "#/$defs/network.RouteConfig" + }, + "type": "array", + "title": "routes", + "description": "Configure routes to be statically created via the link.\n", + "markdownDescription": "Configure routes to be statically created via the link.", + "x-intellij-html-description": "\u003cp\u003eConfigure routes to be statically created via the link.\u003c/p\u003e\n" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "apiVersion", + "bondMode", + "kind", + "links", + "name" + ], + "description": "BondConfig is a config document to create a bond (link aggregation) over a set of links." + }, "network.CommonLinkConfig": { "properties": { "up": { @@ -1810,9 +2141,9 @@ "parent": { "type": "string", "title": "parent", - "description": "Name of the parent link (interface) on which the VLAN link will be created.\n", - "markdownDescription": "Name of the parent link (interface) on which the VLAN link will be created.", - "x-intellij-html-description": "\u003cp\u003eName of the parent link (interface) on which the VLAN link will be created.\u003c/p\u003e\n" + "description": "Name of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.\n", + "markdownDescription": "Name of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.", + "x-intellij-html-description": "\u003cp\u003eName of the parent link (interface) on which the VLAN link will be created.\nLink aliases can be used here as well.\u003c/p\u003e\n" }, "up": { "type": "boolean", @@ -5059,6 +5390,9 @@ { "$ref": "#/$defs/hardware.PCIDriverRebindConfigV1Alpha1" }, + { + "$ref": "#/$defs/network.BondConfigV1Alpha1" + }, { "$ref": "#/$defs/network.DefaultActionConfigV1Alpha1" },