From 6f7c3a8e5c6311bf1a2f9b1cbc6cd02d48746e02 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 30 Aug 2024 22:07:09 +0400 Subject: [PATCH] fix: build of talosctl on non-Linux arches Move META constants out to machinery, and fix up imports. The internal `pkg/meta` package shold not be consumed in public-facing commands. Signed-off-by: Andrey Smirnov --- cmd/installer/pkg/install/install.go | 3 ++- .../internal/server/v1alpha1/v1alpha1_server.go | 2 +- .../pkg/controllers/block/volume_config.go | 2 +- .../pkg/controllers/block/volume_config_test.go | 2 +- .../machined/pkg/controllers/hardware/system.go | 2 +- .../pkg/controllers/hardware/system_test.go | 2 +- .../runtime/drop_upgrade_fallback.go | 2 +- .../runtime/drop_upgrade_fallback_test.go | 7 ++++--- .../pkg/controllers/runtime/unique_token.go | 2 +- .../runtime/v1alpha1/platform/metal/metal.go | 2 +- .../v1alpha1/platform/metal/metal_test.go | 2 +- .../v1alpha1/platform/metal/url/url_test.go | 2 +- .../v1alpha1/platform/metal/url/value.go | 2 +- .../v1alpha1/v1alpha1_sequencer_tasks.go | 5 ++--- .../pkg/runtime/v1alpha1/v1alpha1_state.go | 9 +++++---- .../app/machined/pkg/system/services/etcd.go | 2 +- internal/app/machined/revert.go | 7 ++++--- internal/pkg/dashboard/configurl.go | 2 +- internal/pkg/dashboard/networkconfig.go | 2 +- internal/pkg/meta/meta_test.go | 17 +++++++++-------- pkg/machinery/gendata/data/tag | 2 +- .../pkg => pkg/machinery}/meta/constants.go | 0 website/content/v1.8/reference/cli.md | 4 ++-- 23 files changed, 43 insertions(+), 39 deletions(-) rename {internal/pkg => pkg/machinery}/meta/constants.go (100%) diff --git a/cmd/installer/pkg/install/install.go b/cmd/installer/pkg/install/install.go index ac89f64085..c268ce8110 100644 --- a/cmd/installer/pkg/install/install.go +++ b/cmd/installer/pkg/install/install.go @@ -34,6 +34,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/imager/quirks" "github.com/siderolabs/talos/pkg/machinery/kernel" + metaconsts "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/overlay" "github.com/siderolabs/talos/pkg/machinery/version" ) @@ -410,7 +411,7 @@ func (i *Installer) Install(ctx context.Context, mode Mode) (err error) { var ok bool if mode == ModeUpgrade { - if ok, err = metaState.SetTag(ctx, meta.Upgrade, bootInstallResult.PreviousLabel); !ok || err != nil { + if ok, err = metaState.SetTag(ctx, metaconsts.Upgrade, bootInstallResult.PreviousLabel); !ok || err != nil { return fmt.Errorf("failed to set upgrade tag: %q", bootInstallResult.PreviousLabel) } } diff --git a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go index 6e67935582..cd9e6308e6 100644 --- a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go +++ b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go @@ -60,7 +60,6 @@ import ( "github.com/siderolabs/talos/internal/pkg/containers/cri" "github.com/siderolabs/talos/internal/pkg/etcd" "github.com/siderolabs/talos/internal/pkg/install" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/internal/pkg/miniprocfs" "github.com/siderolabs/talos/internal/pkg/partition" "github.com/siderolabs/talos/internal/pkg/pcap" @@ -81,6 +80,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config/generate/secrets" machinetype "github.com/siderolabs/talos/pkg/machinery/config/machine" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/nethelpers" "github.com/siderolabs/talos/pkg/machinery/resources/block" etcdresource "github.com/siderolabs/talos/pkg/machinery/resources/etcd" diff --git a/internal/app/machined/pkg/controllers/block/volume_config.go b/internal/app/machined/pkg/controllers/block/volume_config.go index 9004aaf25a..74f244a534 100644 --- a/internal/app/machined/pkg/controllers/block/volume_config.go +++ b/internal/app/machined/pkg/controllers/block/volume_config.go @@ -16,13 +16,13 @@ import ( "github.com/siderolabs/go-blockdevice/v2/encryption" "go.uber.org/zap" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/internal/pkg/partition" "github.com/siderolabs/talos/pkg/machinery/cel" "github.com/siderolabs/talos/pkg/machinery/cel/celenv" cfg "github.com/siderolabs/talos/pkg/machinery/config/config" "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/block" "github.com/siderolabs/talos/pkg/machinery/resources/config" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" diff --git a/internal/app/machined/pkg/controllers/block/volume_config_test.go b/internal/app/machined/pkg/controllers/block/volume_config_test.go index 1c37e20e2f..bd0e9f652a 100644 --- a/internal/app/machined/pkg/controllers/block/volume_config_test.go +++ b/internal/app/machined/pkg/controllers/block/volume_config_test.go @@ -15,10 +15,10 @@ import ( blockctrls "github.com/siderolabs/talos/internal/app/machined/pkg/controllers/block" "github.com/siderolabs/talos/internal/app/machined/pkg/controllers/ctest" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/machinery/config/container" "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/block" "github.com/siderolabs/talos/pkg/machinery/resources/config" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" diff --git a/internal/app/machined/pkg/controllers/hardware/system.go b/internal/app/machined/pkg/controllers/hardware/system.go index 1d3f213878..d487e4181a 100644 --- a/internal/app/machined/pkg/controllers/hardware/system.go +++ b/internal/app/machined/pkg/controllers/hardware/system.go @@ -18,8 +18,8 @@ import ( hwadapter "github.com/siderolabs/talos/internal/app/machined/pkg/adapters/hardware" runtimetalos "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" - "github.com/siderolabs/talos/internal/pkg/meta" pkgSMBIOS "github.com/siderolabs/talos/internal/pkg/smbios" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/controllers/hardware/system_test.go b/internal/app/machined/pkg/controllers/hardware/system_test.go index 3f268ee9de..c9fe2609bc 100644 --- a/internal/app/machined/pkg/controllers/hardware/system_test.go +++ b/internal/app/machined/pkg/controllers/hardware/system_test.go @@ -17,7 +17,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/controllers/ctest" hardwarectrl "github.com/siderolabs/talos/internal/app/machined/pkg/controllers/hardware" runtimetalos "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback.go b/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback.go index 0dc963761a..23bef86988 100644 --- a/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback.go +++ b/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback.go @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" machineruntime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback_test.go b/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback_test.go index 790c5ee299..31e58b87c7 100644 --- a/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback_test.go +++ b/internal/app/machined/pkg/controllers/runtime/drop_upgrade_fallback_test.go @@ -22,6 +22,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/controllers/runtime" machineruntime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" "github.com/siderolabs/talos/internal/pkg/meta" + metaconsts "github.com/siderolabs/talos/pkg/machinery/meta" runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) @@ -67,7 +68,7 @@ func TestUpgradeFallbackControllerSuite(t *testing.T) { } func (suite *DropUpgradeFallbackControllerSuite) TestDropUpgradeFallback() { - _, err := suite.meta.SetTag(suite.Ctx(), meta.Upgrade, "A") + _, err := suite.meta.SetTag(suite.Ctx(), metaconsts.Upgrade, "A") suite.Require().NoError(err) machineStatus := runtimeres.NewMachineStatus() @@ -78,7 +79,7 @@ func (suite *DropUpgradeFallbackControllerSuite) TestDropUpgradeFallback() { time.Sleep(time.Second) // controller should not remove the tag - val, ok := suite.meta.ReadTag(meta.Upgrade) + val, ok := suite.meta.ReadTag(metaconsts.Upgrade) suite.Require().True(ok) suite.Require().Equal("A", val) @@ -88,7 +89,7 @@ func (suite *DropUpgradeFallbackControllerSuite) TestDropUpgradeFallback() { suite.Require().NoError(suite.State().Update(suite.Ctx(), machineStatus)) suite.AssertWithin(time.Second, 10*time.Millisecond, func() error { - _, ok = suite.meta.ReadTag(meta.Upgrade) + _, ok = suite.meta.ReadTag(metaconsts.Upgrade) if ok { return retry.ExpectedErrorf("tag is still present") } diff --git a/internal/app/machined/pkg/controllers/runtime/unique_token.go b/internal/app/machined/pkg/controllers/runtime/unique_token.go index c31830379e..8388146a77 100644 --- a/internal/app/machined/pkg/controllers/runtime/unique_token.go +++ b/internal/app/machined/pkg/controllers/runtime/unique_token.go @@ -14,7 +14,7 @@ import ( "github.com/siderolabs/gen/optional" "go.uber.org/zap" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go index be7246d7a6..ccbf858f4d 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go @@ -29,9 +29,9 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/oauth2" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/download" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal_test.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal_test.go index da900013ca..906adc9d52 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal_test.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal_test.go @@ -18,8 +18,8 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/metal" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/url_test.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/url_test.go index be8f884fad..e1715bb5a0 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/url_test.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/url_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/nethelpers" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" "github.com/siderolabs/talos/pkg/machinery/resources/network" diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/value.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/value.go index 182a7bede3..57573050f9 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/value.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url/value.go @@ -10,7 +10,7 @@ import ( "github.com/cosi-project/runtime/pkg/state" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/hardware" "github.com/siderolabs/talos/pkg/machinery/resources/network" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" diff --git a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go index cb94e94c64..e6ee2a7e12 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go @@ -57,7 +57,6 @@ import ( "github.com/siderolabs/talos/internal/pkg/etcd" "github.com/siderolabs/talos/internal/pkg/install" "github.com/siderolabs/talos/internal/pkg/logind" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/internal/pkg/mount" mountv2 "github.com/siderolabs/talos/internal/pkg/mount/v2" "github.com/siderolabs/talos/internal/pkg/partition" @@ -1640,7 +1639,7 @@ func ResetSystemDiskSpec(_ runtime.Sequence, data any) (runtime.TaskExecutionFun if stateWiped && !metaWiped { var removed bool - removed, err = r.State().Machine().Meta().DeleteTag(ctx, meta.StateEncryptionConfig) + removed, err = r.State().Machine().Meta().DeleteTag(ctx, metamachinery.StateEncryptionConfig) if err != nil { return fmt.Errorf("failed to remove state encryption META config tag: %w", err) } @@ -1766,7 +1765,7 @@ func SaveStateEncryptionConfig(runtime.Sequence, any) (runtime.TaskExecutionFunc return err } - ok, err := r.State().Machine().Meta().SetTagBytes(ctx, meta.StateEncryptionConfig, data) + ok, err := r.State().Machine().Meta().SetTagBytes(ctx, metamachinery.StateEncryptionConfig, data) if err != nil { return err } diff --git a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_state.go b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_state.go index 6f58f7a45d..51198d846e 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_state.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_state.go @@ -20,6 +20,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha2" "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/machinery/constants" + metaconsts "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/block" ) @@ -201,15 +202,15 @@ func (s *MachineState) Flush() error { } func (s *MachineState) probeMeta() { - stagedInstallImageRef, ok1 := s.meta.ReadTag(meta.StagedUpgradeImageRef) - stagedInstallOptions, ok2 := s.meta.ReadTag(meta.StagedUpgradeInstallOptions) + stagedInstallImageRef, ok1 := s.meta.ReadTag(metaconsts.StagedUpgradeImageRef) + stagedInstallOptions, ok2 := s.meta.ReadTag(metaconsts.StagedUpgradeInstallOptions) s.stagedInstall = ok1 && ok2 if s.stagedInstall { // clear the staged install flags - _, err1 := s.meta.DeleteTag(context.Background(), meta.StagedUpgradeImageRef) - _, err2 := s.meta.DeleteTag(context.Background(), meta.StagedUpgradeInstallOptions) + _, err1 := s.meta.DeleteTag(context.Background(), metaconsts.StagedUpgradeImageRef) + _, err2 := s.meta.DeleteTag(context.Background(), metaconsts.StagedUpgradeInstallOptions) if err := s.meta.Flush(); err != nil || err1 != nil || err2 != nil { // failed to delete staged install tags, clear the stagedInstall to prevent boot looping diff --git a/internal/app/machined/pkg/system/services/etcd.go b/internal/app/machined/pkg/system/services/etcd.go index 9224b27bd1..41a8b79638 100644 --- a/internal/app/machined/pkg/system/services/etcd.go +++ b/internal/app/machined/pkg/system/services/etcd.go @@ -39,7 +39,6 @@ import ( "github.com/siderolabs/talos/internal/pkg/containers/image" "github.com/siderolabs/talos/internal/pkg/environment" "github.com/siderolabs/talos/internal/pkg/etcd" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/argsbuilder" "github.com/siderolabs/talos/pkg/conditions" "github.com/siderolabs/talos/pkg/filetree" @@ -47,6 +46,7 @@ import ( machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" "github.com/siderolabs/talos/pkg/machinery/config/machine" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/nethelpers" etcdresource "github.com/siderolabs/talos/pkg/machinery/resources/etcd" "github.com/siderolabs/talos/pkg/machinery/resources/k8s" diff --git a/internal/app/machined/revert.go b/internal/app/machined/revert.go index 0d7bcba77f..ef96c48c82 100644 --- a/internal/app/machined/revert.go +++ b/internal/app/machined/revert.go @@ -15,6 +15,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/options" "github.com/siderolabs/talos/internal/pkg/meta" + metaconsts "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/block" ) @@ -59,13 +60,13 @@ func revertBootloadInternal(ctx context.Context, resourceState state.State) erro return err } - label, ok := metaState.ReadTag(meta.Upgrade) + label, ok := metaState.ReadTag(metaconsts.Upgrade) if !ok { return nil } if label == "" { - if _, err = metaState.DeleteTag(ctx, meta.Upgrade); err != nil { + if _, err = metaState.DeleteTag(ctx, metaconsts.Upgrade); err != nil { return err } @@ -85,7 +86,7 @@ func revertBootloadInternal(ctx context.Context, resourceState state.State) erro return err } - if _, err = metaState.DeleteTag(ctx, meta.Upgrade); err != nil { + if _, err = metaState.DeleteTag(ctx, metaconsts.Upgrade); err != nil { return err } diff --git a/internal/pkg/dashboard/configurl.go b/internal/pkg/dashboard/configurl.go index 21e8824766..0307dec80a 100644 --- a/internal/pkg/dashboard/configurl.go +++ b/internal/pkg/dashboard/configurl.go @@ -15,8 +15,8 @@ import ( "google.golang.org/grpc/status" "github.com/siderolabs/talos/internal/pkg/dashboard/resourcedata" - "github.com/siderolabs/talos/internal/pkg/meta" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/meta" runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/pkg/dashboard/networkconfig.go b/internal/pkg/dashboard/networkconfig.go index 6a4976e2b5..40ca32bf4f 100644 --- a/internal/pkg/dashboard/networkconfig.go +++ b/internal/pkg/dashboard/networkconfig.go @@ -18,7 +18,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime" "github.com/siderolabs/talos/internal/pkg/dashboard/resourcedata" - "github.com/siderolabs/talos/internal/pkg/meta" + "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/network" runtimeres "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) diff --git a/internal/pkg/meta/meta_test.go b/internal/pkg/meta/meta_test.go index 4c6509e285..0bbea0c092 100644 --- a/internal/pkg/meta/meta_test.go +++ b/internal/pkg/meta/meta_test.go @@ -19,6 +19,7 @@ import ( "github.com/stretchr/testify/require" "github.com/siderolabs/talos/internal/pkg/meta" + metaconsts "github.com/siderolabs/talos/pkg/machinery/meta" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" ) @@ -51,22 +52,22 @@ func TestFlow(t *testing.T) { ctx := context.Background() - ok, err := m.SetTag(ctx, meta.Upgrade, "1.2.3") + ok, err := m.SetTag(ctx, metaconsts.Upgrade, "1.2.3") require.NoError(t, err) assert.True(t, ok) - val, ok := m.ReadTag(meta.Upgrade) + val, ok := m.ReadTag(metaconsts.Upgrade) assert.True(t, ok) assert.Equal(t, "1.2.3", val) - _, ok = m.ReadTag(meta.StagedUpgradeImageRef) + _, ok = m.ReadTag(metaconsts.StagedUpgradeImageRef) assert.False(t, ok) - ok, err = m.DeleteTag(ctx, meta.Upgrade) + ok, err = m.DeleteTag(ctx, metaconsts.Upgrade) require.NoError(t, err) assert.True(t, ok) - ok, err = m.SetTag(ctx, meta.StagedUpgradeInstallOptions, "install-fast") + ok, err = m.SetTag(ctx, metaconsts.StagedUpgradeInstallOptions, "install-fast") require.NoError(t, err) assert.True(t, ok) @@ -74,17 +75,17 @@ func TestFlow(t *testing.T) { assert.NoError(t, m.Reload(ctx)) - val, ok = m.ReadTag(meta.StagedUpgradeInstallOptions) + val, ok = m.ReadTag(metaconsts.StagedUpgradeInstallOptions) assert.True(t, ok) assert.Equal(t, "install-fast", val) m2, err := meta.New(ctx, st, meta.WithFixedPath(path)) require.NoError(t, err) - _, ok = m2.ReadTag(meta.Upgrade) + _, ok = m2.ReadTag(metaconsts.Upgrade) assert.False(t, ok) - val, ok = m2.ReadTag(meta.StagedUpgradeInstallOptions) + val, ok = m2.ReadTag(metaconsts.StagedUpgradeInstallOptions) assert.True(t, ok) assert.Equal(t, "install-fast", val) diff --git a/pkg/machinery/gendata/data/tag b/pkg/machinery/gendata/data/tag index 6ffb894d7f..22908a2f7a 100644 --- a/pkg/machinery/gendata/data/tag +++ b/pkg/machinery/gendata/data/tag @@ -1 +1 @@ -v1.8.0-alpha.2 \ No newline at end of file +v1.8.0-alpha.1 \ No newline at end of file diff --git a/internal/pkg/meta/constants.go b/pkg/machinery/meta/constants.go similarity index 100% rename from internal/pkg/meta/constants.go rename to pkg/machinery/meta/constants.go diff --git a/website/content/v1.8/reference/cli.md b/website/content/v1.8/reference/cli.md index 6ff714287e..412a4b3bac 100644 --- a/website/content/v1.8/reference/cli.md +++ b/website/content/v1.8/reference/cli.md @@ -96,7 +96,7 @@ talosctl cluster create [flags] --bad-rtc launch VM with bad RTC state (QEMU only) --cidr string CIDR of the cluster network (IPv4, ULA network for IPv6 is derived in automated way) (default "10.5.0.0/24") --cni-bin-path strings search path for CNI binaries (VM only) (default [/home/user/.talos/cni/bin]) - --cni-bundle-url string URL to download CNI bundle from (VM only) (default "https://github.com/siderolabs/talos/releases/download/v1.8.0-alpha.2/talosctl-cni-bundle-${ARCH}.tar.gz") + --cni-bundle-url string URL to download CNI bundle from (VM only) (default "https://github.com/siderolabs/talos/releases/download/v1.8.0-alpha.1/talosctl-cni-bundle-${ARCH}.tar.gz") --cni-cache-dir string CNI cache directory path (VM only) (default "/home/user/.talos/cni/cache") --cni-conf-dir string CNI config directory path (VM only) (default "/home/user/.talos/cni/conf.d") --config-patch stringArray patch generated machineconfigs (applied to all node types), use @file to read a patch from file @@ -2901,7 +2901,7 @@ talosctl upgrade [flags] --debug debug operation from kernel logs. --wait is set to true when this flag is set -f, --force force the upgrade (skip checks on etcd health and members, might lead to data loss) -h, --help help for upgrade - -i, --image string the container image to use for performing the install (default "ghcr.io/siderolabs/installer:v1.8.0-alpha.2") + -i, --image string the container image to use for performing the install (default "ghcr.io/siderolabs/installer:v1.8.0-alpha.1") --insecure upgrade using the insecure (encrypted with no auth) maintenance service -m, --reboot-mode string select the reboot mode during upgrade. Mode "powercycle" bypasses kexec. Valid values are: ["default" "powercycle"]. (default "default") -s, --stage stage the upgrade to perform it after a reboot