feat: use stable network interface names

Use `udevd` rules to create stable interface names.

Link controllers should wait for `udevd` to settle down, otherwise link
rename will fail (interface should not be UP).

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
Andrey Smirnov 2023-05-29 23:00:13 +04:00
parent 196dfb99b0
commit bab484a405
No known key found for this signature in database
GPG Key ID: 7B26396447AB6DFD
54 changed files with 1032 additions and 205 deletions

View File

@ -295,6 +295,7 @@ local load_artifacts = {
AZURE_TENANT: { from_secret: 'az_tenant' },
},
commands: [
'mkdir -p _out/',
'az login --service-principal -u "$${AZURE_STORAGE_USER}" -p "$${AZURE_STORAGE_PASS}" --tenant "$${AZURE_TENANT}"',
'az storage blob download-batch --overwrite true -d _out -s ${CI_COMMIT_SHA}${DRONE_TAG//./-}',
'chmod +x _out/clusterctl _out/integration-test-linux-amd64 _out/module-sig-verify-linux-amd64 _out/kubectl _out/kubestr _out/helm _out/cilium _out/talosctl*',

View File

@ -537,6 +537,7 @@ RUN mkdir -pv /rootfs/opt/{containerd/bin,containerd/lib}
COPY --chmod=0644 hack/containerd.toml /rootfs/etc/containerd/config.toml
COPY --chmod=0644 hack/cri-containerd.toml /rootfs/etc/cri/containerd.toml
COPY --chmod=0644 hack/cri-plugin.part /rootfs/etc/cri/conf.d/00-base.part
COPY --chmod=0644 hack/udevd/80-net-name-slot.rules /rootfs/usr/lib/udev/rules.d/
RUN touch /rootfs/etc/{extensions.yaml,resolv.conf,hosts,os-release,machine-id,cri/conf.d/cri.toml,cri/conf.d/01-registries.part,cri/conf.d/20-customization.part}
RUN ln -s ca-certificates /rootfs/etc/ssl/certs/ca-certificates.crt
RUN ln -s /etc/ssl /rootfs/etc/pki
@ -590,6 +591,7 @@ RUN mkdir -pv /rootfs/opt/{containerd/bin,containerd/lib}
COPY --chmod=0644 hack/containerd.toml /rootfs/etc/containerd/config.toml
COPY --chmod=0644 hack/cri-containerd.toml /rootfs/etc/cri/containerd.toml
COPY --chmod=0644 hack/cri-plugin.part /rootfs/etc/cri/conf.d/00-base.part
COPY --chmod=0644 hack/udevd/80-net-name-slot.rules /rootfs/usr/lib/udev/rules.d/
RUN touch /rootfs/etc/{extensions.yaml,resolv.conf,hosts,os-release,machine-id,cri/conf.d/cri.toml,cri/conf.d/01-registries.part,cri/conf.d/20-customization.part}
RUN ln -s /etc/ssl /rootfs/etc/pki
RUN ln -s ca-certificates /rootfs/etc/ssl/certs/ca-certificates.crt

View File

@ -6,6 +6,11 @@ option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource/defi
import "resource/definitions/enums/enums.proto";
// DevicesStatusSpec is the spec for devices status.
message DevicesStatusSpec {
bool ready = 1;
}
// KernelModuleSpecSpec describes Linux kernel module to load.
message KernelModuleSpecSpec {
string name = 1;

View File

@ -5,11 +5,22 @@
package install
import (
"context"
"fmt"
"log"
"os"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
pkgkernel "github.com/siderolabs/talos/pkg/kernel"
"github.com/siderolabs/talos/pkg/machinery/client"
"github.com/siderolabs/talos/pkg/machinery/compatibility"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/kernel"
"github.com/siderolabs/talos/pkg/machinery/role"
)
// errataBTF handles the case when kexec from pre-BTF kernel to BTF enabled kernel always fails.
@ -31,3 +42,62 @@ func errataBTF() {
log.Printf("failed to disable kexec: %s", err)
}
}
// errataNetIfnames appends the `net.ifnames=0` kernel parameter to the kernel command line if upgrading
// from an old enough version of Talos.
func (i *Installer) errataNetIfnames() error {
if i.cmdline.Get(constants.KernelParamNetIfnames).First() != nil {
// net.ifnames is already set, nothing to do
return nil
}
oldTalos, err := upgradeFromPreIfnamesTalos()
if err != nil {
return err
}
if oldTalos {
log.Printf("appending net.ifnames=0 to the kernel command line")
i.cmdline.Append(constants.KernelParamNetIfnames, "0")
}
return nil
}
func upgradeFromPreIfnamesTalos() (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
if _, err := os.Stat(constants.MachineSocketPath); err != nil {
// old Talos version, include fallback
return true, nil //nolint:nilerr
}
c, err := client.New(ctx,
client.WithUnixSocket(constants.MachineSocketPath),
client.WithGRPCDialOptions(grpc.WithTransportCredentials(insecure.NewCredentials())),
)
if err != nil {
return false, fmt.Errorf("error connecting to the machine service: %w", err)
}
defer c.Close() //nolint:errcheck
// inject "fake" authorization
ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs(constants.APIAuthzRoleMetadataKey, string(role.Admin)))
resp, err := c.Version(ctx)
if err != nil {
return false, fmt.Errorf("error getting Talos version: %w", err)
}
hostVersion := unpack(resp.Messages)
talosVersion, err := compatibility.ParseTalosVersion(hostVersion.Version)
if err != nil {
return false, fmt.Errorf("error parsing Talos version: %w", err)
}
return talosVersion.DisablePredictableNetworkInterfaces(), nil
}

View File

@ -184,6 +184,12 @@ func (i *Installer) probeBootPartition() error {
func (i *Installer) Install(seq runtime.Sequence) (err error) {
errataBTF()
if seq == runtime.SequenceUpgrade {
if err = i.errataNetIfnames(); err != nil {
return err
}
}
if err = i.runPreflightChecks(seq); err != nil {
return err
}

View File

@ -40,6 +40,25 @@ it is set to true for new clusters.
When upgrading from a previous version, the feature can be enabled by setting the field to true.
On the first mount of a volume, the quota information will be recalculated, which may take some time.
"""
[notes.ifnames]
title = "Predictable Network Interface Names"
description="""\
Starting with version Talos 1.5, network interfaces are renamed to [predictable names](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/)
same way as `systemd` does that in other Linux distributions.
The naming schema `enx78e7d1ea46da` (based on MAC addresses) is enabled by default, the order of interface naming decisions is:
* firmware/BIOS provided index numbers for on-board devices (example: `eno1`)
* firmware/BIOS provided PCI Express hotplug slot index numbers (example: `ens1`)
* physical/geographical location of the connector of the hardware (example: `enp2s0`)
* interfaces's MAC address (example: `enx78e7d1ea46da`)
The predictable network interface names features can be disabled by specifying `net.ifnames=0` in the kernel command line.
Talos automatically adds the `net.ifnames=0` kernel argument when upgrading from Talos versions before 1.5.
This change doesn't affect "cloud" platforms, like AWS, as Talos automatically adds `net.ifnames=0` to the kernel command line.
"""
[make_deps]

View File

@ -0,0 +1,13 @@
ACTION!="add", GOTO="net_name_slot_end"
SUBSYSTEM!="net", GOTO="net_name_slot_end"
NAME!="", GOTO="net_name_slot_end"
IMPORT{cmdline}="net.ifnames"
ENV{net.ifnames}=="0", GOTO="net_name_slot_end"
NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
NAME=="", ENV{ID_NET_NAME_MAC}!="", NAME="$env{ID_NET_NAME_MAC}"
LABEL="net_name_slot_end"

View File

@ -53,7 +53,7 @@ func (linkConfig *CmdlineLinkConfig) resolveLinkName() error {
if ifaceMAC == mac {
linkConfig.LinkName = iface.Name
break
return nil
}
}

View File

@ -21,6 +21,7 @@ import (
networkadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/network"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/network/watch"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/runtime"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
)
@ -35,13 +36,7 @@ func (ctrl *LinkSpecController) Name() string {
// Inputs implements controller.Controller interface.
func (ctrl *LinkSpecController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: network.NamespaceName,
Type: network.LinkSpecType,
Kind: controller.InputStrong,
},
}
return nil
}
// Outputs implements controller.Controller interface.
@ -58,6 +53,19 @@ func (ctrl *LinkSpecController) Outputs() []controller.Output {
//
//nolint:gocyclo
func (ctrl *LinkSpecController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
// wait for udevd to be healthy, which implies that all link renames are done
if err := runtime.WaitForDevicesReady(ctx, r,
[]controller.Input{
{
Namespace: network.NamespaceName,
Type: network.LinkSpecType,
Kind: controller.InputStrong,
},
},
); err != nil {
return err
}
// watch link changes as some routes might need to be re-applied if the link appears
watcher, err := watch.NewRtNetlink(r, unix.RTMGRP_LINK)
if err != nil {

View File

@ -33,6 +33,7 @@ import (
"github.com/siderolabs/talos/pkg/logging"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
type LinkSpecSuite struct {
@ -61,6 +62,11 @@ func (suite *LinkSpecSuite) SetupTest() {
suite.runtime, err = runtime.NewRuntime(suite.state, logging.Wrap(log.Writer()))
suite.Require().NoError(err)
// create fake device ready status
deviceStatus := runtimeres.NewDevicesStatus(runtimeres.NamespaceName, runtimeres.DevicesID)
deviceStatus.TypedSpec().Ready = true
suite.Require().NoError(suite.state.Create(suite.ctx, deviceStatus))
suite.Require().NoError(suite.runtime.RegisterController(&netctrl.LinkSpecController{}))
// register status controller to assert on the created links

View File

@ -23,6 +23,7 @@ import (
networkadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/network"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/network/watch"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/runtime"
"github.com/siderolabs/talos/internal/pkg/pci"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
@ -38,13 +39,7 @@ func (ctrl *LinkStatusController) Name() string {
// Inputs implements controller.Controller interface.
func (ctrl *LinkStatusController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: network.NamespaceName,
Type: network.LinkRefreshType,
Kind: controller.InputWeak,
},
}
return nil
}
// Outputs implements controller.Controller interface.
@ -61,6 +56,19 @@ func (ctrl *LinkStatusController) Outputs() []controller.Output {
//
//nolint:gocyclo
func (ctrl *LinkStatusController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
// wait for udevd to be healthy, which implies that all link renames are done
if err := runtime.WaitForDevicesReady(ctx, r,
[]controller.Input{
{
Namespace: network.NamespaceName,
Type: network.LinkSpecType,
Kind: controller.InputStrong,
},
},
); err != nil {
return err
}
// create watch connections to rtnetlink and ethtool via genetlink
// these connections are used only to join multicast groups and receive notifications on changes
// other connections are used to send requests and receive responses, as we can't mix the notifications and request/responses

View File

@ -33,6 +33,7 @@ import (
"github.com/siderolabs/talos/pkg/logging"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
type LinkStatusSuite struct {
@ -57,6 +58,11 @@ func (suite *LinkStatusSuite) SetupTest() {
suite.runtime, err = runtime.NewRuntime(suite.state, logging.Wrap(log.Writer()))
suite.Require().NoError(err)
// create fake device ready status
deviceStatus := runtimeres.NewDevicesStatus(runtimeres.NamespaceName, runtimeres.DevicesID)
deviceStatus.TypedSpec().Ready = true
suite.Require().NoError(suite.state.Create(suite.ctx, deviceStatus))
suite.Require().NoError(suite.runtime.RegisterController(&netctrl.LinkStatusController{}))
suite.startRuntime()

View File

@ -29,6 +29,7 @@ import (
"github.com/siderolabs/talos/pkg/logging"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
type NodeAddressSuite struct {
@ -104,6 +105,11 @@ func (suite *NodeAddressSuite) assertAddresses(requiredIDs []string, check func(
}
func (suite *NodeAddressSuite) TestDefaults() {
// create fake device ready status
deviceStatus := runtimeres.NewDevicesStatus(runtimeres.NamespaceName, runtimeres.DevicesID)
deviceStatus.TypedSpec().Ready = true
suite.Require().NoError(suite.state.Create(suite.ctx, deviceStatus))
suite.Require().NoError(suite.runtime.RegisterController(&netctrl.AddressStatusController{}))
suite.Require().NoError(suite.runtime.RegisterController(&netctrl.LinkStatusController{}))

View File

@ -0,0 +1,68 @@
// 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 runtime
import (
"context"
"github.com/cosi-project/runtime/pkg/controller"
"github.com/cosi-project/runtime/pkg/safe"
"go.uber.org/zap"
"github.com/siderolabs/talos/internal/app/machined/pkg/controllers/v1alpha1"
machineruntime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
// DevicesStatusController loads extensions.yaml and updates DevicesStatus resources.
type DevicesStatusController struct {
V1Alpha1Mode machineruntime.Mode
}
// Name implements controller.Controller interface.
func (ctrl *DevicesStatusController) Name() string {
return "runtime.DevicesStatusController"
}
// Inputs implements controller.Controller interface.
func (ctrl *DevicesStatusController) Inputs() []controller.Input {
return nil
}
// Outputs implements controller.Controller interface.
func (ctrl *DevicesStatusController) Outputs() []controller.Output {
return []controller.Output{
{
Type: runtime.DevicesStatusType,
Kind: controller.OutputExclusive,
},
}
}
// Run implements controller.Controller interface.
func (ctrl *DevicesStatusController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error {
// in container mode, devices are always ready
if ctrl.V1Alpha1Mode != machineruntime.ModeContainer {
if err := v1alpha1.WaitForServiceHealthy(ctx, r, "udevd", nil); err != nil {
return err
}
}
for {
select {
case <-ctx.Done():
return nil
case <-r.EventCh():
}
if err := safe.WriterModify(ctx, r, runtime.NewDevicesStatus(runtime.NamespaceName, runtime.DevicesID), func(status *runtime.DevicesStatus) error {
status.TypedSpec().Ready = true
return nil
}); err != nil {
return err
}
}
}

View File

@ -0,0 +1,65 @@
// 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 runtime
import (
"context"
"github.com/cosi-project/runtime/pkg/controller"
"github.com/cosi-project/runtime/pkg/safe"
"github.com/cosi-project/runtime/pkg/state"
"github.com/siderolabs/go-pointer"
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
// WaitForDevicesReady waits for devices to be ready.
//
// It is a helper function for controllers.
func WaitForDevicesReady(ctx context.Context, r controller.Runtime, nextInputs []controller.Input) error {
// set inputs temporarily to a service only
if err := r.UpdateInputs([]controller.Input{
{
Namespace: runtime.NamespaceName,
Type: runtime.DevicesStatusType,
ID: pointer.To(runtime.DevicesID),
Kind: controller.InputWeak,
},
}); err != nil {
return err
}
for {
select {
case <-ctx.Done():
return ctx.Err()
case <-r.EventCh():
}
status, err := safe.ReaderGetByID[*runtime.DevicesStatus](ctx, r, runtime.DevicesID)
if err != nil {
if state.IsNotFoundError(err) {
continue
}
return err
}
if status.TypedSpec().Ready {
// condition met
break
}
}
// restore inputs
if err := r.UpdateInputs(nextInputs); err != nil {
return err
}
// queue an update to reprocess with new inputs
r.QueueReconcile()
return nil
}

View File

@ -0,0 +1,65 @@
// 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 v1alpha1
import (
"context"
"github.com/cosi-project/runtime/pkg/controller"
"github.com/cosi-project/runtime/pkg/safe"
"github.com/cosi-project/runtime/pkg/state"
"github.com/siderolabs/go-pointer"
"github.com/siderolabs/talos/pkg/machinery/resources/v1alpha1"
)
// WaitForServiceHealthy waits for a service to be healthy.
//
// It is a helper function for controllers.
func WaitForServiceHealthy(ctx context.Context, r controller.Runtime, serviceID string, nextInputs []controller.Input) error {
// set inputs temporarily to a service only
if err := r.UpdateInputs([]controller.Input{
{
Namespace: v1alpha1.NamespaceName,
Type: v1alpha1.ServiceType,
ID: pointer.To(serviceID),
Kind: controller.InputWeak,
},
}); err != nil {
return err
}
for {
select {
case <-ctx.Done():
return ctx.Err()
case <-r.EventCh():
}
service, err := safe.ReaderGetByID[*v1alpha1.Service](ctx, r, serviceID)
if err != nil {
if state.IsNotFoundError(err) {
continue
}
return err
}
if service.TypedSpec().Running && service.TypedSpec().Healthy {
// condition met
break
}
}
// restore inputs
if err := r.UpdateInputs(nextInputs); err != nil {
return err
}
// queue an update to reprocess with new inputs
r.QueueReconcile()
return nil
}

View File

@ -25,6 +25,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
@ -145,6 +146,7 @@ func (a *AWS) Mode() runtime.Mode {
func (a *AWS) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -27,6 +27,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
@ -196,6 +197,7 @@ func (a *Azure) KernelArgs() procfs.Parameters {
procfs.NewParameter("console").Append("ttyS0,115200n8"),
procfs.NewParameter("earlyprintk").Append("ttyS0,115200"),
procfs.NewParameter("rootdelay").Append("300"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -20,6 +20,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/address"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -258,6 +259,7 @@ func (d *DigitalOcean) Mode() runtime.Mode {
func (d *DigitalOcean) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("ttyS0").Append("tty0").Append("tty1"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -19,6 +19,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
@ -88,6 +89,7 @@ func (e *Exoscale) Mode() runtime.Mode {
func (e *Exoscale) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -21,6 +21,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -200,6 +201,7 @@ func (g *GCP) Mode() runtime.Mode {
func (g *GCP) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -20,6 +20,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -168,6 +169,7 @@ func (h *Hcloud) Mode() runtime.Mode {
func (h *Hcloud) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -16,6 +16,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
@ -93,6 +94,7 @@ func (n *Nocloud) Mode() runtime.Mode {
func (n *Nocloud) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -24,6 +24,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/address"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -346,6 +347,7 @@ func (o *Openstack) Mode() runtime.Mode {
func (o *Openstack) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -21,6 +21,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)
@ -139,6 +140,7 @@ func (o *Oracle) Mode() runtime.Mode {
func (o *Oracle) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -21,6 +21,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -184,6 +185,7 @@ func (s *Scaleway) Mode() runtime.Mode {
func (s *Scaleway) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty1").Append("ttyS0"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -18,6 +18,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -195,7 +196,9 @@ func (u *UpCloud) Mode() runtime.Mode {
// KernelArgs implements the runtime.Platform interface.
func (u *UpCloud) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{}
return []*procfs.Parameter{
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}
// NetworkConfiguration implements the runtime.Platform interface.

View File

@ -199,6 +199,7 @@ func (v *VMware) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{
procfs.NewParameter("console").Append("tty0").Append("ttyS0"),
procfs.NewParameter("earlyprintk").Append("ttyS0,115200"),
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}

View File

@ -20,6 +20,7 @@ import (
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/errors"
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils"
"github.com/siderolabs/talos/pkg/download"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/nethelpers"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime"
@ -176,7 +177,9 @@ func (v *Vultr) Mode() runtime.Mode {
// KernelArgs implements the runtime.Platform interface.
func (v *Vultr) KernelArgs() procfs.Parameters {
return []*procfs.Parameter{}
return []*procfs.Parameter{
procfs.NewParameter(constants.KernelParamNetIfnames).Append("0"),
}
}
// NetworkConfiguration implements the runtime.Platform interface.

View File

@ -213,6 +213,9 @@ func (ctrl *Controller) Run(ctx context.Context, drainer *runtime.Drainer) error
&network.TimeServerSpecController{},
&perf.StatsController{},
&runtimecontrollers.CRIImageGCController{},
&runtimecontrollers.DevicesStatusController{
V1Alpha1Mode: ctrl.v1alpha1Runtime.State().Platform().Mode(),
},
&runtimecontrollers.EventsSinkController{
V1Alpha1Events: ctrl.v1alpha1Runtime.Events(),
Cmdline: procfs.ProcCmdline(),

View File

@ -163,6 +163,7 @@ func NewState() (*State, error) {
&network.TimeServerSpec{},
&perf.CPU{},
&perf.Memory{},
&runtime.DevicesStatus{},
&runtime.ExtensionStatus{},
&runtime.KernelModuleSpec{},
&runtime.KernelParamSpec{},

View File

@ -173,6 +173,7 @@ func RunInstallerContainer(disk, platform, ref string, cfg configcore.Config, cf
constants.KernelParamLoggingKernel,
constants.KernelParamEquinixMetalEvents,
constants.KernelParamDashboardDisabled,
constants.KernelParamNetIfnames,
} {
if c := procfs.ProcCmdline().Get(preservedArg).First(); c != nil {
args = append(args, "--extra-kernel-arg", fmt.Sprintf("%s=%s", preservedArg, *c))

View File

@ -13,6 +13,7 @@ import (
"github.com/siderolabs/talos/pkg/machinery/api/machine"
"github.com/siderolabs/talos/pkg/machinery/client"
"github.com/siderolabs/talos/pkg/machinery/config/container"
v1alpha1config "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
"github.com/siderolabs/talos/pkg/machinery/resources/config"
)
@ -46,7 +47,7 @@ func patchNodeConfig(ctx context.Context, cluster UpgradeProvider, node string,
return fmt.Errorf("error patching config: %w", err)
}
cfgBytes, err := mc.Container().EncodeBytes()
cfgBytes, err := container.NewV1Alpha1(cfg).EncodeBytes()
if err != nil {
return fmt.Errorf("error serializing config: %w", err)
}

View File

@ -23,6 +23,54 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// DevicesStatusSpec is the spec for devices status.
type DevicesStatusSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"`
}
func (x *DevicesStatusSpec) Reset() {
*x = DevicesStatusSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DevicesStatusSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DevicesStatusSpec) ProtoMessage() {}
func (x *DevicesStatusSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DevicesStatusSpec.ProtoReflect.Descriptor instead.
func (*DevicesStatusSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{0}
}
func (x *DevicesStatusSpec) GetReady() bool {
if x != nil {
return x.Ready
}
return false
}
// KernelModuleSpecSpec describes Linux kernel module to load.
type KernelModuleSpecSpec struct {
state protoimpl.MessageState
@ -36,7 +84,7 @@ type KernelModuleSpecSpec struct {
func (x *KernelModuleSpecSpec) Reset() {
*x = KernelModuleSpecSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[0]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -49,7 +97,7 @@ func (x *KernelModuleSpecSpec) String() string {
func (*KernelModuleSpecSpec) ProtoMessage() {}
func (x *KernelModuleSpecSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[0]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -62,7 +110,7 @@ func (x *KernelModuleSpecSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use KernelModuleSpecSpec.ProtoReflect.Descriptor instead.
func (*KernelModuleSpecSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{0}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{1}
}
func (x *KernelModuleSpecSpec) GetName() string {
@ -92,7 +140,7 @@ type KernelParamSpecSpec struct {
func (x *KernelParamSpecSpec) Reset() {
*x = KernelParamSpecSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[1]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -105,7 +153,7 @@ func (x *KernelParamSpecSpec) String() string {
func (*KernelParamSpecSpec) ProtoMessage() {}
func (x *KernelParamSpecSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[1]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -118,7 +166,7 @@ func (x *KernelParamSpecSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use KernelParamSpecSpec.ProtoReflect.Descriptor instead.
func (*KernelParamSpecSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{1}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{2}
}
func (x *KernelParamSpecSpec) GetValue() string {
@ -149,7 +197,7 @@ type KernelParamStatusSpec struct {
func (x *KernelParamStatusSpec) Reset() {
*x = KernelParamStatusSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -162,7 +210,7 @@ func (x *KernelParamStatusSpec) String() string {
func (*KernelParamStatusSpec) ProtoMessage() {}
func (x *KernelParamStatusSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[2]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -175,7 +223,7 @@ func (x *KernelParamStatusSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use KernelParamStatusSpec.ProtoReflect.Descriptor instead.
func (*KernelParamStatusSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{2}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{3}
}
func (x *KernelParamStatusSpec) GetCurrent() string {
@ -212,7 +260,7 @@ type MachineStatusSpec struct {
func (x *MachineStatusSpec) Reset() {
*x = MachineStatusSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -225,7 +273,7 @@ func (x *MachineStatusSpec) String() string {
func (*MachineStatusSpec) ProtoMessage() {}
func (x *MachineStatusSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[3]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -238,7 +286,7 @@ func (x *MachineStatusSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use MachineStatusSpec.ProtoReflect.Descriptor instead.
func (*MachineStatusSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{3}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{4}
}
func (x *MachineStatusSpec) GetStage() enums.RuntimeMachineStage {
@ -268,7 +316,7 @@ type MachineStatusStatus struct {
func (x *MachineStatusStatus) Reset() {
*x = MachineStatusStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -281,7 +329,7 @@ func (x *MachineStatusStatus) String() string {
func (*MachineStatusStatus) ProtoMessage() {}
func (x *MachineStatusStatus) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[4]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -294,7 +342,7 @@ func (x *MachineStatusStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use MachineStatusStatus.ProtoReflect.Descriptor instead.
func (*MachineStatusStatus) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{4}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{5}
}
func (x *MachineStatusStatus) GetReady() bool {
@ -323,7 +371,7 @@ type MetaKeySpec struct {
func (x *MetaKeySpec) Reset() {
*x = MetaKeySpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[5]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -336,7 +384,7 @@ func (x *MetaKeySpec) String() string {
func (*MetaKeySpec) ProtoMessage() {}
func (x *MetaKeySpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[5]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -349,7 +397,7 @@ func (x *MetaKeySpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use MetaKeySpec.ProtoReflect.Descriptor instead.
func (*MetaKeySpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{5}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{6}
}
func (x *MetaKeySpec) GetValue() string {
@ -374,7 +422,7 @@ type MountStatusSpec struct {
func (x *MountStatusSpec) Reset() {
*x = MountStatusSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[6]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -387,7 +435,7 @@ func (x *MountStatusSpec) String() string {
func (*MountStatusSpec) ProtoMessage() {}
func (x *MountStatusSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[6]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -400,7 +448,7 @@ func (x *MountStatusSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use MountStatusSpec.ProtoReflect.Descriptor instead.
func (*MountStatusSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{6}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{7}
}
func (x *MountStatusSpec) GetSource() string {
@ -450,7 +498,7 @@ type PlatformMetadataSpec struct {
func (x *PlatformMetadataSpec) Reset() {
*x = PlatformMetadataSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[7]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -463,7 +511,7 @@ func (x *PlatformMetadataSpec) String() string {
func (*PlatformMetadataSpec) ProtoMessage() {}
func (x *PlatformMetadataSpec) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[7]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -476,7 +524,7 @@ func (x *PlatformMetadataSpec) ProtoReflect() protoreflect.Message {
// Deprecated: Use PlatformMetadataSpec.ProtoReflect.Descriptor instead.
func (*PlatformMetadataSpec) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{7}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{8}
}
func (x *PlatformMetadataSpec) GetPlatform() string {
@ -548,7 +596,7 @@ type UnmetCondition struct {
func (x *UnmetCondition) Reset() {
*x = UnmetCondition{}
if protoimpl.UnsafeEnabled {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[8]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -561,7 +609,7 @@ func (x *UnmetCondition) String() string {
func (*UnmetCondition) ProtoMessage() {}
func (x *UnmetCondition) ProtoReflect() protoreflect.Message {
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[8]
mi := &file_resource_definitions_runtime_runtime_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -574,7 +622,7 @@ func (x *UnmetCondition) ProtoReflect() protoreflect.Message {
// Deprecated: Use UnmetCondition.ProtoReflect.Descriptor instead.
func (*UnmetCondition) Descriptor() ([]byte, []int) {
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{8}
return file_resource_definitions_runtime_runtime_proto_rawDescGZIP(), []int{9}
}
func (x *UnmetCondition) GetName() string {
@ -601,79 +649,82 @@ var file_resource_definitions_runtime_runtime_proto_rawDesc = []byte{
0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x1a, 0x26, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2f, 0x65, 0x6e, 0x75,
0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x14, 0x4b, 0x65, 0x72, 0x6e,
0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
0x74, 0x65, 0x72, 0x73, 0x22, 0x50, 0x0a, 0x13, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x15, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12,
0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66,
0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61,
0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74,
0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70,
0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4b, 0x0a, 0x05, 0x73,
0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x61, 0x6c,
0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69,
0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x52, 0x75,
0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67,
0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73,
0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x4d, 0x61,
0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61,
0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x5d, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x65, 0x74,
0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x32, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72,
0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x23, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65,
0x79, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f,
0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12,
0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12,
0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x79,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x22, 0xf5, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a,
0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12,
0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61,
0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76,
0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x6e,
0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x6c, 0x61, 0x62,
0x73, 0x2f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72,
0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69,
0x63, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a,
0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65,
0x61, 0x64, 0x79, 0x22, 0x4a, 0x0a, 0x14, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4d, 0x6f, 0x64,
0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22,
0x50, 0x0a, 0x13, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x53, 0x70,
0x65, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d,
0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72,
0x73, 0x22, 0x6d, 0x0a, 0x15, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75,
0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x72,
0x72, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20,
0x0a, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64,
0x22, 0xb1, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, 0x05, 0x73, 0x74,
0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05,
0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61,
0x64, 0x79, 0x12, 0x5d, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x64,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x74,
0x61, 0x6c, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x64, 0x65,
0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d,
0x65, 0x2e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x22, 0x23, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x53, 0x70, 0x65, 0x63,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x75, 0x6e, 0x74,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69,
0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54,
0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04,
0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xf5, 0x01,
0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64,
0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x73, 0x70, 0x6f, 0x74, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x6e, 0x6d, 0x65, 0x74, 0x43, 0x6f,
0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72,
0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61,
0x73, 0x6f, 0x6e, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x74, 0x61, 0x6c,
0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x64, 0x65,
0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d,
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -688,28 +739,29 @@ func file_resource_definitions_runtime_runtime_proto_rawDescGZIP() []byte {
return file_resource_definitions_runtime_runtime_proto_rawDescData
}
var file_resource_definitions_runtime_runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_resource_definitions_runtime_runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_resource_definitions_runtime_runtime_proto_goTypes = []interface{}{
(*KernelModuleSpecSpec)(nil), // 0: talos.resource.definitions.runtime.KernelModuleSpecSpec
(*KernelParamSpecSpec)(nil), // 1: talos.resource.definitions.runtime.KernelParamSpecSpec
(*KernelParamStatusSpec)(nil), // 2: talos.resource.definitions.runtime.KernelParamStatusSpec
(*MachineStatusSpec)(nil), // 3: talos.resource.definitions.runtime.MachineStatusSpec
(*MachineStatusStatus)(nil), // 4: talos.resource.definitions.runtime.MachineStatusStatus
(*MetaKeySpec)(nil), // 5: talos.resource.definitions.runtime.MetaKeySpec
(*MountStatusSpec)(nil), // 6: talos.resource.definitions.runtime.MountStatusSpec
(*PlatformMetadataSpec)(nil), // 7: talos.resource.definitions.runtime.PlatformMetadataSpec
(*UnmetCondition)(nil), // 8: talos.resource.definitions.runtime.UnmetCondition
(enums.RuntimeMachineStage)(0), // 9: talos.resource.definitions.enums.RuntimeMachineStage
(*DevicesStatusSpec)(nil), // 0: talos.resource.definitions.runtime.DevicesStatusSpec
(*KernelModuleSpecSpec)(nil), // 1: talos.resource.definitions.runtime.KernelModuleSpecSpec
(*KernelParamSpecSpec)(nil), // 2: talos.resource.definitions.runtime.KernelParamSpecSpec
(*KernelParamStatusSpec)(nil), // 3: talos.resource.definitions.runtime.KernelParamStatusSpec
(*MachineStatusSpec)(nil), // 4: talos.resource.definitions.runtime.MachineStatusSpec
(*MachineStatusStatus)(nil), // 5: talos.resource.definitions.runtime.MachineStatusStatus
(*MetaKeySpec)(nil), // 6: talos.resource.definitions.runtime.MetaKeySpec
(*MountStatusSpec)(nil), // 7: talos.resource.definitions.runtime.MountStatusSpec
(*PlatformMetadataSpec)(nil), // 8: talos.resource.definitions.runtime.PlatformMetadataSpec
(*UnmetCondition)(nil), // 9: talos.resource.definitions.runtime.UnmetCondition
(enums.RuntimeMachineStage)(0), // 10: talos.resource.definitions.enums.RuntimeMachineStage
}
var file_resource_definitions_runtime_runtime_proto_depIdxs = []int32{
9, // 0: talos.resource.definitions.runtime.MachineStatusSpec.stage:type_name -> talos.resource.definitions.enums.RuntimeMachineStage
4, // 1: talos.resource.definitions.runtime.MachineStatusSpec.status:type_name -> talos.resource.definitions.runtime.MachineStatusStatus
8, // 2: talos.resource.definitions.runtime.MachineStatusStatus.unmet_conditions:type_name -> talos.resource.definitions.runtime.UnmetCondition
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
10, // 0: talos.resource.definitions.runtime.MachineStatusSpec.stage:type_name -> talos.resource.definitions.enums.RuntimeMachineStage
5, // 1: talos.resource.definitions.runtime.MachineStatusSpec.status:type_name -> talos.resource.definitions.runtime.MachineStatusStatus
9, // 2: talos.resource.definitions.runtime.MachineStatusStatus.unmet_conditions:type_name -> talos.resource.definitions.runtime.UnmetCondition
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_resource_definitions_runtime_runtime_proto_init() }
@ -719,7 +771,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_resource_definitions_runtime_runtime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KernelModuleSpecSpec); i {
switch v := v.(*DevicesStatusSpec); i {
case 0:
return &v.state
case 1:
@ -731,7 +783,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KernelParamSpecSpec); i {
switch v := v.(*KernelModuleSpecSpec); i {
case 0:
return &v.state
case 1:
@ -743,7 +795,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KernelParamStatusSpec); i {
switch v := v.(*KernelParamSpecSpec); i {
case 0:
return &v.state
case 1:
@ -755,7 +807,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MachineStatusSpec); i {
switch v := v.(*KernelParamStatusSpec); i {
case 0:
return &v.state
case 1:
@ -767,7 +819,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MachineStatusStatus); i {
switch v := v.(*MachineStatusSpec); i {
case 0:
return &v.state
case 1:
@ -779,7 +831,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MetaKeySpec); i {
switch v := v.(*MachineStatusStatus); i {
case 0:
return &v.state
case 1:
@ -791,7 +843,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MountStatusSpec); i {
switch v := v.(*MetaKeySpec); i {
case 0:
return &v.state
case 1:
@ -803,7 +855,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlatformMetadataSpec); i {
switch v := v.(*MountStatusSpec); i {
case 0:
return &v.state
case 1:
@ -815,6 +867,18 @@ func file_resource_definitions_runtime_runtime_proto_init() {
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlatformMetadataSpec); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_resource_definitions_runtime_runtime_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UnmetCondition); i {
case 0:
return &v.state
@ -833,7 +897,7 @@ func file_resource_definitions_runtime_runtime_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_resource_definitions_runtime_runtime_proto_rawDesc,
NumEnums: 0,
NumMessages: 9,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -21,6 +21,49 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
func (m *DevicesStatusSpec) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
size := m.SizeVT()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DevicesStatusSpec) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *DevicesStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
i := len(dAtA)
_ = i
var l int
_ = l
if m.unknownFields != nil {
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if m.Ready {
i--
if m.Ready {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *KernelModuleSpecSpec) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
@ -533,6 +576,19 @@ func encodeVarint(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func (m *DevicesStatusSpec) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Ready {
n += 2
}
n += len(m.unknownFields)
return n
}
func (m *KernelModuleSpecSpec) SizeVT() (n int) {
if m == nil {
return 0
@ -734,6 +790,77 @@ func sov(x uint64) (n int) {
func soz(x uint64) (n int) {
return sov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *DevicesStatusSpec) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: DevicesStatusSpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: DevicesStatusSpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Ready", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Ready = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skip(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLength
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *KernelModuleSpecSpec) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0

View File

@ -39,6 +39,15 @@ func (v *TalosVersion) String() string {
return v.version.String()
}
// DisablePredictableNetworkInterfaces returns true if predictable network interfaces should be disabled on upgrade.
func (v *TalosVersion) DisablePredictableNetworkInterfaces() bool {
if v.majorMinor[0] <= talos14.MajorMinor[0] && v.majorMinor[1] <= talos14.MajorMinor[1] {
return true
}
return false
}
// UpgradeableFrom checks if the current version of Talos can be used as an upgrade for the given host version.
func (v *TalosVersion) UpgradeableFrom(host *TalosVersion) error {
var (

View File

@ -179,3 +179,38 @@ func TestTalosUpgradeCompatibilityUnsupported(t *testing.T) {
runTalosVersionTest(t, tt)
}
}
func TestDisablePredictableNetworkInterfaces(t *testing.T) {
for _, tt := range []struct {
host string
expected bool
}{
{
host: "1.3.0",
expected: true,
},
{
host: "1.4.0",
expected: true,
},
{
host: "1.5.0",
expected: false,
},
{
host: "1.6.0",
expected: false,
},
} {
tt := tt
t.Run(tt.host, func(t *testing.T) {
host, err := compatibility.ParseTalosVersion(&machine.VersionInfo{
Tag: tt.host,
})
require.NoError(t, err)
require.Equal(t, tt.expected, host.DisablePredictableNetworkInterfaces())
})
}
}

View File

@ -31,8 +31,58 @@ func WithNetworkNameservers(nameservers ...string) NetworkConfigOption {
}
}
// IfaceSelector is a helper type to select network interface.
//
// It might either to select interface by name or by selector.
type IfaceSelector struct {
Name *string
Selector *NetworkDeviceSelector
}
// matches checks if Device matches selector.
func (selector IfaceSelector) matches(dev *Device) bool {
if selector.Name != nil && *selector.Name == dev.DeviceInterface {
return true
}
if selector.Selector != nil && dev.DeviceSelector != nil && *selector.Selector == *dev.DeviceSelector {
return true
}
return false
}
// new returns new Device with selector.
func (selector IfaceSelector) new() *Device {
dev := &Device{}
if selector.Name != nil {
dev.DeviceInterface = *selector.Name
}
if selector.Selector != nil {
dev.DeviceSelector = selector.Selector
}
return dev
}
// IfaceByName selects interface by name.
func IfaceByName(name string) IfaceSelector {
return IfaceSelector{
Name: &name,
}
}
// IfaceBySelector selects interface by selector.
func IfaceBySelector(selector NetworkDeviceSelector) IfaceSelector {
return IfaceSelector{
Selector: &selector,
}
}
// WithNetworkInterfaceIgnore marks interface as ignored.
func WithNetworkInterfaceIgnore(iface string) NetworkConfigOption {
func WithNetworkInterfaceIgnore(iface IfaceSelector) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
cfg.getDevice(iface).DeviceIgnore = pointer.To(true)
@ -41,7 +91,7 @@ func WithNetworkInterfaceIgnore(iface string) NetworkConfigOption {
}
// WithNetworkInterfaceDHCP enables DHCP for the interface.
func WithNetworkInterfaceDHCP(iface string, enable bool) NetworkConfigOption {
func WithNetworkInterfaceDHCP(iface IfaceSelector, enable bool) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
cfg.getDevice(iface).DeviceDHCP = pointer.To(true)
@ -50,7 +100,7 @@ func WithNetworkInterfaceDHCP(iface string, enable bool) NetworkConfigOption {
}
// WithNetworkInterfaceDHCPv4 enables DHCPv4 for the interface.
func WithNetworkInterfaceDHCPv4(iface string, enable bool) NetworkConfigOption {
func WithNetworkInterfaceDHCPv4(iface IfaceSelector, enable bool) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
dev := cfg.getDevice(iface)
@ -65,7 +115,7 @@ func WithNetworkInterfaceDHCPv4(iface string, enable bool) NetworkConfigOption {
}
// WithNetworkInterfaceDHCPv6 enables DHCPv6 for the interface.
func WithNetworkInterfaceDHCPv6(iface string, enable bool) NetworkConfigOption {
func WithNetworkInterfaceDHCPv6(iface IfaceSelector, enable bool) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
dev := cfg.getDevice(iface)
@ -80,7 +130,7 @@ func WithNetworkInterfaceDHCPv6(iface string, enable bool) NetworkConfigOption {
}
// WithNetworkInterfaceCIDR configures interface for static addressing.
func WithNetworkInterfaceCIDR(iface, cidr string) NetworkConfigOption {
func WithNetworkInterfaceCIDR(iface IfaceSelector, cidr string) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
cfg.getDevice(iface).DeviceAddresses = append(cfg.getDevice(iface).DeviceAddresses, cidr)
@ -89,7 +139,7 @@ func WithNetworkInterfaceCIDR(iface, cidr string) NetworkConfigOption {
}
// WithNetworkInterfaceMTU configures interface MTU.
func WithNetworkInterfaceMTU(iface string, mtu int) NetworkConfigOption {
func WithNetworkInterfaceMTU(iface IfaceSelector, mtu int) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
cfg.getDevice(iface).DeviceMTU = mtu
@ -98,7 +148,7 @@ func WithNetworkInterfaceMTU(iface string, mtu int) NetworkConfigOption {
}
// WithNetworkInterfaceWireguard configures interface for Wireguard.
func WithNetworkInterfaceWireguard(iface string, wireguardConfig *DeviceWireguardConfig) NetworkConfigOption {
func WithNetworkInterfaceWireguard(iface IfaceSelector, wireguardConfig *DeviceWireguardConfig) NetworkConfigOption {
return func(_ machine.Type, cfg *NetworkConfig) error {
cfg.getDevice(iface).DeviceWireguardConfig = wireguardConfig
@ -107,7 +157,7 @@ func WithNetworkInterfaceWireguard(iface string, wireguardConfig *DeviceWireguar
}
// WithNetworkInterfaceVirtualIP configures interface for Virtual IP.
func WithNetworkInterfaceVirtualIP(iface, cidr string) NetworkConfigOption {
func WithNetworkInterfaceVirtualIP(iface IfaceSelector, cidr string) NetworkConfigOption {
return func(machineType machine.Type, cfg *NetworkConfig) error {
if machineType == machine.TypeWorker {
return nil

View File

@ -523,16 +523,14 @@ func (n *NetworkConfig) Devices() []config.Device {
// getDevice adds or returns existing Device by name.
//
// This method mutates configuration, but it's only used in config generation.
func (n *NetworkConfig) getDevice(name string) *Device {
func (n *NetworkConfig) getDevice(iface IfaceSelector) *Device {
for _, dev := range n.NetworkInterfaces {
if dev.DeviceInterface == name {
if iface.matches(dev) {
return dev
}
}
dev := &Device{
DeviceInterface: name,
}
dev := iface.new()
n.NetworkInterfaces = append(n.NetworkInterfaces, dev)

View File

@ -156,7 +156,7 @@ var (
NetworkHostname: "worker-1",
NetworkInterfaces: []*Device{
{
DeviceInterface: "eth0",
DeviceInterface: "enp0s1",
DeviceAddresses: []string{"192.168.2.0/24"},
DeviceMTU: 1500,
DeviceRoutes: []*Route{
@ -425,11 +425,11 @@ var (
networkConfigBondExample = &Bond{
BondMode: "802.3ad",
BondLACPRate: "fast",
BondInterfaces: []string{"eth0", "eth1"},
BondInterfaces: []string{"enp2s0", "enp2s1"},
}
networkConfigBridgeExample = &Bridge{
BridgedInterfaces: []string{"eth0", "eth1"},
BridgedInterfaces: []string{"enxda4042ca9a51", "enxae2a6774c259"},
BridgeSTP: &STP{
STPEnabled: pointer.To(true),
},
@ -2135,7 +2135,7 @@ type Device struct {
// The interface name.
// Mutually exclusive with `deviceSelector`.
// examples:
// - value: '"eth0"'
// - value: '"enp0s3"'
DeviceInterface string `yaml:"interface,omitempty"`
// description: |
// Picks a network device using the selector.

View File

@ -1679,7 +1679,7 @@ func init() {
DeviceDoc.Fields[0].Description = "The interface name.\nMutually exclusive with `deviceSelector`."
DeviceDoc.Fields[0].Comments[encoder.LineComment] = "The interface name."
DeviceDoc.Fields[0].AddExample("", "eth0")
DeviceDoc.Fields[0].AddExample("", "enp0s3")
DeviceDoc.Fields[1].Name = "deviceSelector"
DeviceDoc.Fields[1].Type = "NetworkDeviceSelector"
DeviceDoc.Fields[1].Note = ""

View File

@ -976,6 +976,32 @@ func (in *FeaturesConfig) DeepCopy() *FeaturesConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IfaceSelector) DeepCopyInto(out *IfaceSelector) {
*out = *in
if in.Name != nil {
in, out := &in.Name, &out.Name
*out = new(string)
**out = **in
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(NetworkDeviceSelector)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IfaceSelector.
func (in *IfaceSelector) DeepCopy() *IfaceSelector {
if in == nil {
return nil
}
out := new(IfaceSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *InstallConfig) DeepCopyInto(out *InstallConfig) {
*out = *in

View File

@ -55,6 +55,9 @@ const (
// KernelParamEnvironment is the kernel parameter name for passing process environment.
KernelParamEnvironment = "talos.environment"
// KernelParamNetIfnames is the kernel parameter name to control predictable network interface names.
KernelParamNetIfnames = "net.ifnames"
// BoardNone indicates that the install is not for a specific board.
BoardNone = "none"

View File

@ -2,10 +2,16 @@
// 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 KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
// Code generated by "deep-copy -type DevicesStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go ."; DO NOT EDIT.
package runtime
// DeepCopy generates a deep copy of DevicesStatusSpec.
func (o DevicesStatusSpec) DeepCopy() DevicesStatusSpec {
var cp DevicesStatusSpec = o
return cp
}
// DeepCopy generates a deep copy of KernelModuleSpecSpec.
func (o KernelModuleSpecSpec) DeepCopy() KernelModuleSpecSpec {
var cp KernelModuleSpecSpec = o

View File

@ -0,0 +1,66 @@
// 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 runtime
import (
"github.com/cosi-project/runtime/pkg/resource"
"github.com/cosi-project/runtime/pkg/resource/meta"
"github.com/cosi-project/runtime/pkg/resource/protobuf"
"github.com/cosi-project/runtime/pkg/resource/typed"
"github.com/siderolabs/talos/pkg/machinery/proto"
)
// DevicesStatusType is type of DevicesStatus resource.
const DevicesStatusType = resource.Type("DevicesStatuses.runtime.talos.dev")
// DevicesStatus resource holds status of hardware devices (overall).
type DevicesStatus = typed.Resource[DevicesStatusSpec, DevicesStatusExtension]
// DevicesID is the ID of DevicesStatus resource.
const DevicesID = resource.ID("devices")
// DevicesStatusSpec is the spec for devices status.
//
//gotagsrewrite:gen
type DevicesStatusSpec struct {
// Devices are settled down and ready to be used.
Ready bool `yaml:"ready" protobuf:"1"`
}
// NewDevicesStatus initializes a DevicesStatus resource.
func NewDevicesStatus(namespace resource.Namespace, id resource.ID) *DevicesStatus {
return typed.NewResource[DevicesStatusSpec, DevicesStatusExtension](
resource.NewMetadata(namespace, DevicesStatusType, id, resource.VersionUndefined),
DevicesStatusSpec{},
)
}
// DevicesStatusExtension is auxiliary resource data for DevicesStatus.
type DevicesStatusExtension struct{}
// ResourceDefinition implements meta.ResourceDefinitionProvider interface.
func (DevicesStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec {
return meta.ResourceDefinitionSpec{
Type: DevicesStatusType,
Aliases: []resource.Type{},
DefaultNamespace: NamespaceName,
PrintColumns: []meta.PrintColumn{
{
Name: "Ready",
JSONPath: `{.ready}`,
},
},
}
}
func init() {
proto.RegisterDefaultTypes()
err := protobuf.RegisterDynamic[DevicesStatusSpec](DevicesStatusType, &DevicesStatus{})
if err != nil {
panic(err)
}
}

View File

@ -5,4 +5,4 @@
package runtime
//nolint:lll
//go:generate deep-copy -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go .
//go:generate deep-copy -type DevicesStatusSpec -type KernelModuleSpecSpec -type KernelParamSpecSpec -type KernelParamStatusSpec -type MachineStatusSpec -type MetaKeySpec -type MountStatusSpec -type PlatformMetadataSpec -header-file ../../../../hack/boilerplate.txt -o deep_copy.generated.go .

View File

@ -25,6 +25,7 @@ func TestRegisterResource(t *testing.T) {
resourceRegistry := registry.NewResourceRegistry(resources)
for _, resource := range []resource.Resource{
&runtime.DevicesStatus{},
&runtime.ExtensionStatus{},
&runtime.KernelModuleSpec{},
&runtime.KernelParamSpec{},

View File

@ -71,7 +71,7 @@ func (p *provisioner) GenOptions(networkReq provision.NetworkRequest) []generate
return []generate.Option{
generate.WithNetworkOptions(
v1alpha1.WithNetworkInterfaceIgnore("eth0"),
v1alpha1.WithNetworkInterfaceIgnore(v1alpha1.IfaceByName("eth0")),
v1alpha1.WithNetworkNameservers(nameservers...),
),
}
@ -101,8 +101,8 @@ func (p *provisioner) UserDiskName(index int) string {
}
// GetFirstInterface returns first network interface name.
func (p *provisioner) GetFirstInterface() string {
return "eth0"
func (p *provisioner) GetFirstInterface() v1alpha1.IfaceSelector {
return v1alpha1.IfaceByName("eth0")
}
func detectWSL() bool {

View File

@ -46,6 +46,10 @@ func (p *provisioner) GenOptions(networkReq provision.NetworkRequest) []generate
}
}
virtioSelector := v1alpha1.IfaceBySelector(v1alpha1.NetworkDeviceSelector{
NetworkDeviceKernelDriver: "virtio_net",
})
return []generate.Option{
generate.WithInstallDisk("/dev/vda"),
generate.WithInstallExtraKernelArgs([]string{
@ -58,9 +62,9 @@ func (p *provisioner) GenOptions(networkReq provision.NetworkRequest) []generate
"talos.platform=metal",
}),
generate.WithNetworkOptions(
v1alpha1.WithNetworkInterfaceDHCP("eth0", true),
v1alpha1.WithNetworkInterfaceDHCPv4("eth0", hasIPv4),
v1alpha1.WithNetworkInterfaceDHCPv6("eth0", hasIPv6),
v1alpha1.WithNetworkInterfaceDHCP(virtioSelector, true),
v1alpha1.WithNetworkInterfaceDHCPv4(virtioSelector, hasIPv4),
v1alpha1.WithNetworkInterfaceDHCPv6(virtioSelector, hasIPv6),
),
}
}
@ -72,6 +76,8 @@ func (p *provisioner) GetLoadBalancers(networkReq provision.NetworkRequest) (int
}
// GetFirstInterface returns first network interface name.
func (p *provisioner) GetFirstInterface() string {
return "eth0"
func (p *provisioner) GetFirstInterface() v1alpha1.IfaceSelector {
return v1alpha1.IfaceBySelector(v1alpha1.NetworkDeviceSelector{
NetworkDeviceKernelDriver: "virtio_net",
})
}

View File

@ -10,6 +10,7 @@ import (
"io"
"github.com/siderolabs/talos/pkg/machinery/config/generate"
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
)
// Provisioner is an interface each provisioner should implement.
@ -23,7 +24,7 @@ type Provisioner interface {
GenOptions(NetworkRequest) []generate.Option
GetLoadBalancers(NetworkRequest) (internalEndpoint, externalEndpoint string)
GetFirstInterface() string
GetFirstInterface() v1alpha1.IfaceSelector
Close() error

View File

@ -66,7 +66,7 @@ sudo --preserve-env=HOME _out/talosctl-linux-amd64 cluster create \
--provisioner=qemu \
--cidr=172.20.0.0/24 \
--registry-mirror docker.io=http://172.20.0.1:5000 \
--registry-mirror kregistry.k8s.io=http://172.20.0.1:5001 \
--registry-mirror registry.k8s.io=http://172.20.0.1:5001 \
--registry-mirror gcr.io=http://172.20.0.1:5003 \
--registry-mirror ghcr.io=http://172.20.0.1:5004 \
--registry-mirror 127.0.0.1:5005=http://172.20.0.1:5005 \
@ -298,3 +298,37 @@ The following lines should appear in the output of the `talosctl debug air-gappe
- `GET /debug.yaml`: Talos successfully fetches the extra manifest successfully
There might be more output depending on the registry caches being used or not.
## Running Upgrade Integration Tests
Talos has a separate set of provision upgrade tests, which create a cluster on older versions of Talos, perform an upgrade,
and verify that the cluster is still functional.
Build the test binary:
```bash
rm -f _out/integration-test-provision-linux-amd64; make _out/integration-test-provision-linux-amd64
```
Prepare the test artifacts for the upgrade test:
```bash
make release-artifacts
```
Build and push an installer image for the development version of Talos:
```bash
make installer IMAGE_REGISTRY=127.0.0.1:5005 PUSH=true
```
Run the tests (the tests will create the cluster on the older version of Talos, perform an upgrade, and verify that the cluster is still functional):
```bash
sudo --preserve-env=HOME _out/integration-test-provision-linux-amd64 \
-test.v \
-talos.talosctlpath _out/talosctl-linux-amd64 \
-talos.provision.target-installer-registry=127.0.0.1:5005 \
-talos.provision.registry-mirror 127.0.0.1:5005=http://172.20.0.1:5005,docker.io=http://172.20.0.1:5000,registry.k8s.io=http://172.20.0.1:5001,quay.io=http://172.20.0.1:5002,gcr.io=http://172.20.0.1:5003,ghcr.io=http://172.20.0.1:5004 \
-talos.provision.cidr 172.20.0.0/24
```

View File

@ -175,6 +175,7 @@ description: Talos gRPC API reference.
- [Mount](#talos.resource.definitions.proto.Mount)
- [resource/definitions/runtime/runtime.proto](#resource/definitions/runtime/runtime.proto)
- [DevicesStatusSpec](#talos.resource.definitions.runtime.DevicesStatusSpec)
- [KernelModuleSpecSpec](#talos.resource.definitions.runtime.KernelModuleSpecSpec)
- [KernelParamSpecSpec](#talos.resource.definitions.runtime.KernelParamSpecSpec)
- [KernelParamStatusSpec](#talos.resource.definitions.runtime.KernelParamStatusSpec)
@ -3206,6 +3207,21 @@ Mount specifies a mount for a container.
<a name="talos.resource.definitions.runtime.DevicesStatusSpec"></a>
### DevicesStatusSpec
DevicesStatusSpec is the spec for devices status.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ready | [bool](#bool) | | |
<a name="talos.resource.definitions.runtime.KernelModuleSpecSpec"></a>
### KernelModuleSpecSpec

View File

@ -150,7 +150,7 @@ network:
hostname: worker-1 # Used to statically set the hostname for the machine.
# `interfaces` is used to define the network interface configuration.
interfaces:
- interface: eth0 # The interface name.
- interface: enp0s1 # The interface name.
# Assigns static IP addresses to the interface.
addresses:
- 192.168.2.0/24
@ -180,8 +180,8 @@ network:
# bond:
# # The interfaces that make up the bond.
# interfaces:
# - eth0
# - eth1
# - enp2s0
# - enp2s1
# # Picks a network device using the selector.
# deviceSelectors:
# - busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -194,8 +194,8 @@ network:
# bridge:
# # The interfaces that make up the bridge.
# interfaces:
# - eth0
# - eth1
# - enxda4042ca9a51
# - enxae2a6774c259
# # A bridge option.
# stp:
# enabled: true # Whether Spanning Tree Protocol (STP) is enabled.
@ -859,7 +859,7 @@ Appears in:
hostname: worker-1 # Used to statically set the hostname for the machine.
# `interfaces` is used to define the network interface configuration.
interfaces:
- interface: eth0 # The interface name.
- interface: enp0s1 # The interface name.
# Assigns static IP addresses to the interface.
addresses:
- 192.168.2.0/24
@ -889,8 +889,8 @@ interfaces:
# bond:
# # The interfaces that make up the bond.
# interfaces:
# - eth0
# - eth1
# - enp2s0
# - enp2s1
# # Picks a network device using the selector.
# deviceSelectors:
# - busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -903,8 +903,8 @@ interfaces:
# bridge:
# # The interfaces that make up the bridge.
# interfaces:
# - eth0
# - eth1
# - enxda4042ca9a51
# - enxae2a6774c259
# # A bridge option.
# stp:
# enabled: true # Whether Spanning Tree Protocol (STP) is enabled.
@ -970,7 +970,7 @@ nameservers:
|`hostname` |string |Used to statically set the hostname for the machine. | |
|`interfaces` |[]<a href="#device">Device</a> |<details><summary>`interfaces` is used to define the network interface configuration.</summary>By default all network interfaces will attempt a DHCP discovery.<br />This can be further tuned through this configuration parameter.</details> <details><summary>Show example(s)</summary>{{< highlight yaml >}}
interfaces:
- interface: eth0 # The interface name.
- interface: enp0s1 # The interface name.
# Assigns static IP addresses to the interface.
addresses:
- 192.168.2.0/24
@ -1000,8 +1000,8 @@ interfaces:
# bond:
# # The interfaces that make up the bond.
# interfaces:
# - eth0
# - eth1
# - enp2s0
# - enp2s1
# # Picks a network device using the selector.
# deviceSelectors:
# - busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -1014,8 +1014,8 @@ interfaces:
# bridge:
# # The interfaces that make up the bridge.
# interfaces:
# - eth0
# - eth1
# - enxda4042ca9a51
# - enxae2a6774c259
# # A bridge option.
# stp:
# enabled: true # Whether Spanning Tree Protocol (STP) is enabled.
@ -1978,7 +1978,7 @@ Appears in:
{{< highlight yaml >}}
- interface: eth0 # The interface name.
- interface: enp0s1 # The interface name.
# Assigns static IP addresses to the interface.
addresses:
- 192.168.2.0/24
@ -2008,8 +2008,8 @@ Appears in:
# bond:
# # The interfaces that make up the bond.
# interfaces:
# - eth0
# - eth1
# - enp2s0
# - enp2s1
# # Picks a network device using the selector.
# deviceSelectors:
# - busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -2022,8 +2022,8 @@ Appears in:
# bridge:
# # The interfaces that make up the bridge.
# interfaces:
# - eth0
# - eth1
# - enxda4042ca9a51
# - enxae2a6774c259
# # A bridge option.
# stp:
# enabled: true # Whether Spanning Tree Protocol (STP) is enabled.
@ -2071,7 +2071,7 @@ Appears in:
| Field | Type | Description | Value(s) |
|-------|------|-------------|----------|
|`interface` |string |<details><summary>The interface name.</summary>Mutually exclusive with `deviceSelector`.</details> <details><summary>Show example(s)</summary>{{< highlight yaml >}}
interface: eth0
interface: enp0s3
{{< /highlight >}}</details> | |
|`deviceSelector` |<a href="#networkdeviceselector">NetworkDeviceSelector</a> |<details><summary>Picks a network device using the selector.</summary>Mutually exclusive with `interface`.<br />Supports partial match using wildcard syntax.</details> <details><summary>Show example(s)</summary>{{< highlight yaml >}}
deviceSelector:
@ -2097,8 +2097,8 @@ routes:
bond:
# The interfaces that make up the bond.
interfaces:
- eth0
- eth1
- enp2s0
- enp2s1
# Picks a network device using the selector.
deviceSelectors:
- busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -2111,8 +2111,8 @@ bond:
bridge:
# The interfaces that make up the bridge.
interfaces:
- eth0
- eth1
- enxda4042ca9a51
- enxae2a6774c259
# A bridge option.
stp:
enabled: true # Whether Spanning Tree Protocol (STP) is enabled.
@ -2318,8 +2318,8 @@ Appears in:
{{< highlight yaml >}}
# The interfaces that make up the bond.
interfaces:
- eth0
- eth1
- enp2s0
- enp2s1
# Picks a network device using the selector.
deviceSelectors:
- busPath: 00:* # PCI, USB bus prefix, supports matching by wildcard.
@ -2398,8 +2398,8 @@ Appears in:
{{< highlight yaml >}}
# The interfaces that make up the bridge.
interfaces:
- eth0
- eth1
- enxda4042ca9a51
- enxae2a6774c259
# A bridge option.
stp:
enabled: true # Whether Spanning Tree Protocol (STP) is enabled.

View File

@ -90,6 +90,10 @@ An example of a vlan configuration including static ip configuration:
This will create a vlan interface named `eth0.100` with `eth0` as the underlying interface and set the vlan id to 100 with static IP 172.20.0.2/24 and 172.20.0.1 as default gateway.
#### `net.ifnames=0`
Disable the predictable network interface names by specifying `net.ifnames=0` on the kernel command line.
#### `panic`
The amount of time to wait after a panic before a reboot is issued.