diff --git a/cmd/installer/cmd/installer/install.go b/cmd/installer/cmd/installer/install.go index 128a462d5..c65069617 100644 --- a/cmd/installer/cmd/installer/install.go +++ b/cmd/installer/cmd/installer/install.go @@ -15,7 +15,7 @@ import ( "github.com/siderolabs/talos/cmd/installer/pkg/install" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/platform" "github.com/siderolabs/talos/pkg/machinery/config/configloader" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // installCmd represents the installation command. diff --git a/cmd/installer/pkg/install/install.go b/cmd/installer/pkg/install/install.go index 351bab709..4fb09f689 100644 --- a/cmd/installer/pkg/install/install.go +++ b/cmd/installer/pkg/install/install.go @@ -25,7 +25,7 @@ import ( "github.com/siderolabs/talos/internal/pkg/mount" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/kernel" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // Options represents the set of options available for an install. diff --git a/cmd/installer/pkg/install/preflight.go b/cmd/installer/pkg/install/preflight.go index 8c7755bdc..d7a86b964 100644 --- a/cmd/installer/pkg/install/preflight.go +++ b/cmd/installer/pkg/install/preflight.go @@ -22,7 +22,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/resources/k8s" "github.com/siderolabs/talos/pkg/machinery/role" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // PreflightChecks runs the preflight checks. diff --git a/cmd/talosctl/cmd/mgmt/cluster/create.go b/cmd/talosctl/cmd/mgmt/cluster/create.go index 12b74bf7a..74565a5e2 100644 --- a/cmd/talosctl/cmd/mgmt/cluster/create.go +++ b/cmd/talosctl/cmd/mgmt/cluster/create.go @@ -45,10 +45,10 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/nethelpers" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/provision" "github.com/siderolabs/talos/pkg/provision/access" "github.com/siderolabs/talos/pkg/provision/providers" - "github.com/siderolabs/talos/pkg/version" ) const ( diff --git a/cmd/talosctl/cmd/talos/inspect.go b/cmd/talosctl/cmd/talos/inspect.go index 200cdcfea..68d22f5e6 100644 --- a/cmd/talosctl/cmd/talos/inspect.go +++ b/cmd/talosctl/cmd/talos/inspect.go @@ -14,6 +14,7 @@ import ( "github.com/siderolabs/talos/cmd/talosctl/pkg/talos/helpers" "github.com/siderolabs/talos/pkg/cli" "github.com/siderolabs/talos/pkg/machinery/client" + "github.com/siderolabs/talos/pkg/machinery/formatters" ) // inspectCmd represents the inspect command. @@ -54,7 +55,7 @@ to render the graph: cli.Warning("%s", err) } - return cli.RenderGraph(ctx, c, resp, os.Stdout, inspectDependenciesCmdFlags.withResources) + return formatters.RenderGraph(ctx, c, resp, os.Stdout, inspectDependenciesCmdFlags.withResources) }) }, } diff --git a/cmd/talosctl/cmd/talos/mounts.go b/cmd/talosctl/cmd/talos/mounts.go index a5bd3efa3..843d48e2b 100644 --- a/cmd/talosctl/cmd/talos/mounts.go +++ b/cmd/talosctl/cmd/talos/mounts.go @@ -15,6 +15,7 @@ import ( "github.com/siderolabs/talos/pkg/cli" "github.com/siderolabs/talos/pkg/machinery/client" + "github.com/siderolabs/talos/pkg/machinery/formatters" ) // mountsCmd represents the mounts command. @@ -37,7 +38,7 @@ var mountsCmd = &cobra.Command{ cli.Warning("%s", err) } - return cli.RenderMounts(resp, os.Stdout, &remotePeer) + return formatters.RenderMounts(resp, os.Stdout, &remotePeer) }) }, } diff --git a/cmd/talosctl/cmd/talos/root.go b/cmd/talosctl/cmd/talos/root.go index f86e6e2f6..ef47fb005 100644 --- a/cmd/talosctl/cmd/talos/root.go +++ b/cmd/talosctl/cmd/talos/root.go @@ -20,12 +20,12 @@ import ( "google.golang.org/grpc/peer" "github.com/siderolabs/talos/cmd/talosctl/pkg/talos/global" - "github.com/siderolabs/talos/pkg/cli" _ "github.com/siderolabs/talos/pkg/grpc/codec" // register codec "github.com/siderolabs/talos/pkg/machinery/api/common" machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" "github.com/siderolabs/talos/pkg/machinery/client" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/formatters" ) var kubernetes bool @@ -165,7 +165,7 @@ func getServiceFromNode() []string { for _, msg := range resp.Messages { for _, s := range msg.Services { - svc := cli.ServiceInfoWrapper{ServiceInfo: s} + svc := formatters.ServiceInfoWrapper{ServiceInfo: s} svcIDs = append(svcIDs, svc.Id) } } diff --git a/cmd/talosctl/cmd/talos/service.go b/cmd/talosctl/cmd/talos/service.go index 54f62bf5d..85d3f6a1a 100644 --- a/cmd/talosctl/cmd/talos/service.go +++ b/cmd/talosctl/cmd/talos/service.go @@ -16,6 +16,7 @@ import ( "github.com/siderolabs/talos/pkg/cli" "github.com/siderolabs/talos/pkg/machinery/client" + "github.com/siderolabs/talos/pkg/machinery/formatters" ) // serviceCmd represents the service command. @@ -89,7 +90,7 @@ func serviceList(ctx context.Context, c *client.Client) error { for _, msg := range resp.Messages { for _, s := range msg.Services { - svc := cli.ServiceInfoWrapper{ServiceInfo: s} + svc := formatters.ServiceInfoWrapper{ServiceInfo: s} node := defaultNode @@ -122,7 +123,7 @@ func serviceInfo(ctx context.Context, c *client.Client, id string) error { return fmt.Errorf("service %q is not registered on any nodes", id) } - return cli.RenderServicesInfo(services, os.Stdout, defaultNode, true) + return formatters.RenderServicesInfo(services, os.Stdout, defaultNode, true) } func serviceStart(ctx context.Context, c *client.Client, id string) error { diff --git a/cmd/talosctl/cmd/talos/upgrade.go b/cmd/talosctl/cmd/talos/upgrade.go index 58452ded6..df0d4de13 100644 --- a/cmd/talosctl/cmd/talos/upgrade.go +++ b/cmd/talosctl/cmd/talos/upgrade.go @@ -26,7 +26,7 @@ import ( "github.com/siderolabs/talos/pkg/images" "github.com/siderolabs/talos/pkg/machinery/api/machine" "github.com/siderolabs/talos/pkg/machinery/client" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) var upgradeCmdFlags struct { diff --git a/cmd/talosctl/cmd/talos/version.go b/cmd/talosctl/cmd/talos/version.go index 2f272e0b7..4f6062cc4 100644 --- a/cmd/talosctl/cmd/talos/version.go +++ b/cmd/talosctl/cmd/talos/version.go @@ -16,7 +16,7 @@ import ( "github.com/siderolabs/talos/pkg/cli" "github.com/siderolabs/talos/pkg/machinery/client" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // versionCmdFlags represents the `talosctl version` command's flags. diff --git a/cmd/talosctl/pkg/mgmt/helpers/image.go b/cmd/talosctl/pkg/mgmt/helpers/image.go index a27c8f731..bdabec1d3 100644 --- a/cmd/talosctl/pkg/mgmt/helpers/image.go +++ b/cmd/talosctl/pkg/mgmt/helpers/image.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // DefaultImage appends default image version. diff --git a/cmd/talosctl/pkg/talos/helpers/checks.go b/cmd/talosctl/pkg/talos/helpers/checks.go index 3fde276ed..c6aea2fe6 100644 --- a/cmd/talosctl/pkg/talos/helpers/checks.go +++ b/cmd/talosctl/pkg/talos/helpers/checks.go @@ -16,7 +16,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/api/common" "github.com/siderolabs/talos/pkg/machinery/client" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // FailIfMultiNodes checks if ctx contains multi-node request metadata. diff --git a/go.mod b/go.mod index 25c47de7c..5670ec1c5 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,6 @@ require ( github.com/docker/go-connections v0.5.0 github.com/dustin/go-humanize v1.0.1 github.com/ecks/uefi v0.0.0-20221116212947-caef65d070eb - github.com/emicklei/dot v1.6.1 github.com/fatih/color v1.16.0 github.com/foxboron/go-uefi v0.0.0-20240128152106-48be911532c2 github.com/freddierice/go-losetup/v2 v2.0.1 @@ -215,6 +214,7 @@ require ( github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect diff --git a/internal/app/apid/pkg/backend/apid_test.go b/internal/app/apid/pkg/backend/apid_test.go index 364788323..b7821d368 100644 --- a/internal/app/apid/pkg/backend/apid_test.go +++ b/internal/app/apid/pkg/backend/apid_test.go @@ -32,7 +32,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config" "github.com/siderolabs/talos/pkg/machinery/proto" "github.com/siderolabs/talos/pkg/machinery/role" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) type APIDSuite struct { diff --git a/internal/app/init/main.go b/internal/app/init/main.go index 6d0c98922..1a4d32f81 100644 --- a/internal/app/init/main.go +++ b/internal/app/init/main.go @@ -29,7 +29,7 @@ import ( "github.com/siderolabs/talos/internal/pkg/secureboot/tpm2" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/extensions" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) func init() { diff --git a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go index f37a95951..cc2ffc621 100644 --- a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go +++ b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go @@ -87,7 +87,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/network" timeresource "github.com/siderolabs/talos/pkg/machinery/resources/time" "github.com/siderolabs/talos/pkg/machinery/role" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // MinimumEtcdUpgradeLeaseLockSeconds indicates the minimum number of seconds for which we open a lease lock for upgrading Etcd nodes. diff --git a/internal/app/machined/pkg/controllers/cluster/discovery_service.go b/internal/app/machined/pkg/controllers/cluster/discovery_service.go index 4870da0a8..9177d8fd8 100644 --- a/internal/app/machined/pkg/controllers/cluster/discovery_service.go +++ b/internal/app/machined/pkg/controllers/cluster/discovery_service.go @@ -30,7 +30,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/kubespan" "github.com/siderolabs/talos/pkg/machinery/resources/network" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) const defaultDiscoveryTTL = 30 * time.Minute diff --git a/internal/app/machined/pkg/controllers/cluster/local_affiliate.go b/internal/app/machined/pkg/controllers/cluster/local_affiliate.go index 06474fd0f..d79ef4869 100644 --- a/internal/app/machined/pkg/controllers/cluster/local_affiliate.go +++ b/internal/app/machined/pkg/controllers/cluster/local_affiliate.go @@ -25,7 +25,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/k8s" "github.com/siderolabs/talos/pkg/machinery/resources/kubespan" "github.com/siderolabs/talos/pkg/machinery/resources/network" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // LocalAffiliateController builds Affiliate resource for the local node. diff --git a/internal/app/machined/pkg/controllers/cluster/local_affiliate_test.go b/internal/app/machined/pkg/controllers/cluster/local_affiliate_test.go index c43e42912..3f965f98f 100644 --- a/internal/app/machined/pkg/controllers/cluster/local_affiliate_test.go +++ b/internal/app/machined/pkg/controllers/cluster/local_affiliate_test.go @@ -23,7 +23,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/k8s" "github.com/siderolabs/talos/pkg/machinery/resources/kubespan" "github.com/siderolabs/talos/pkg/machinery/resources/network" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) type LocalAffiliateSuite struct { diff --git a/internal/app/machined/pkg/controllers/siderolink/manager.go b/internal/app/machined/pkg/controllers/siderolink/manager.go index 440d00dc9..ab5d8c03b 100644 --- a/internal/app/machined/pkg/controllers/siderolink/manager.go +++ b/internal/app/machined/pkg/controllers/siderolink/manager.go @@ -38,7 +38,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/network" "github.com/siderolabs/talos/pkg/machinery/resources/runtime" "github.com/siderolabs/talos/pkg/machinery/resources/siderolink" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // ManagerController interacts with SideroLink API and brings up the SideroLink Wireguard interface. diff --git a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub.go b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub.go index 1c41775e1..e0f877bf5 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub.go @@ -11,7 +11,7 @@ import ( "path/filepath" "github.com/siderolabs/talos/pkg/machinery/constants" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // Config represents a grub configuration file (grub.cfg). diff --git a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub_test.go b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub_test.go index a14497747..2c8ceafa0 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub_test.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub/grub_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/require" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) var ( 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 0970b874d..25de0d19e 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go @@ -78,8 +78,8 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/k8s" resourceruntime "github.com/siderolabs/talos/pkg/machinery/resources/runtime" resourcev1alpha1 "github.com/siderolabs/talos/pkg/machinery/resources/v1alpha1" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/minimal" - "github.com/siderolabs/talos/pkg/version" ) // WaitForUSB represents the WaitForUSB task. diff --git a/internal/app/maintenance/server.go b/internal/app/maintenance/server.go index 77061ae9e..6c7f45df8 100644 --- a/internal/app/maintenance/server.go +++ b/internal/app/maintenance/server.go @@ -35,7 +35,7 @@ import ( v1alpha1machine "github.com/siderolabs/talos/pkg/machinery/config/machine" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/role" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // Server implements [machine.MachineServiceServer], network.NetworkService, and [storage.StorageServiceServer]. diff --git a/internal/integration/cli/version.go b/internal/integration/cli/version.go index 7d1884c47..f175036fd 100644 --- a/internal/integration/cli/version.go +++ b/internal/integration/cli/version.go @@ -10,7 +10,7 @@ import ( "regexp" "github.com/siderolabs/talos/internal/integration/base" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // VersionSuite verifies version command. diff --git a/internal/integration/integration_test.go b/internal/integration/integration_test.go index 0b1669dd8..caa68a908 100644 --- a/internal/integration/integration_test.go +++ b/internal/integration/integration_test.go @@ -25,9 +25,9 @@ import ( "github.com/siderolabs/talos/pkg/images" clientconfig "github.com/siderolabs/talos/pkg/machinery/client/config" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/provision" "github.com/siderolabs/talos/pkg/provision/providers" - "github.com/siderolabs/talos/pkg/version" ) // Accumulated list of all the suites to run. diff --git a/internal/integration/k8s/tink.go b/internal/integration/k8s/tink.go index c699446d0..57f4f1f95 100644 --- a/internal/integration/k8s/tink.go +++ b/internal/integration/k8s/tink.go @@ -39,7 +39,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config/generate" "github.com/siderolabs/talos/pkg/machinery/config/machine" "github.com/siderolabs/talos/pkg/machinery/constants" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // TinkSuite verifies Talos-in-Kubernetes. diff --git a/internal/integration/provision/provision.go b/internal/integration/provision/provision.go index f21169965..5230399da 100644 --- a/internal/integration/provision/provision.go +++ b/internal/integration/provision/provision.go @@ -44,10 +44,10 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/nethelpers" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/provision" "github.com/siderolabs/talos/pkg/provision/access" "github.com/siderolabs/talos/pkg/provision/providers/qemu" - "github.com/siderolabs/talos/pkg/version" ) var allSuites []suite.TestingSuite diff --git a/internal/pkg/extensions/extensions_test.go b/internal/pkg/extensions/extensions_test.go index 435d396ed..df4583465 100644 --- a/internal/pkg/extensions/extensions_test.go +++ b/internal/pkg/extensions/extensions_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/siderolabs/talos/internal/pkg/extensions" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) func TestLoadValidate(t *testing.T) { diff --git a/internal/pkg/extensions/validate.go b/internal/pkg/extensions/validate.go index 9e660d87e..ed5e56966 100644 --- a/internal/pkg/extensions/validate.go +++ b/internal/pkg/extensions/validate.go @@ -14,7 +14,7 @@ import ( "github.com/blang/semver/v4" "github.com/siderolabs/talos/pkg/machinery/extensions" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // Validate the extension: compatibility, contents, etc. diff --git a/internal/pkg/secureboot/uki/generate.go b/internal/pkg/secureboot/uki/generate.go index c25a05daa..a4d5623e0 100644 --- a/internal/pkg/secureboot/uki/generate.go +++ b/internal/pkg/secureboot/uki/generate.go @@ -17,8 +17,8 @@ import ( "github.com/siderolabs/talos/internal/pkg/secureboot" "github.com/siderolabs/talos/internal/pkg/secureboot/measure" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/splash" - "github.com/siderolabs/talos/pkg/version" ) func (builder *Builder) generateOSRel() error { diff --git a/internal/pkg/tui/installer/installer.go b/internal/pkg/tui/installer/installer.go index 051fb4662..93fd90e11 100644 --- a/internal/pkg/tui/installer/installer.go +++ b/internal/pkg/tui/installer/installer.go @@ -18,7 +18,7 @@ import ( "github.com/siderolabs/talos/internal/pkg/tui/components" machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" clientconfig "github.com/siderolabs/talos/pkg/machinery/client/config" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // NewPage creates a new installer page. diff --git a/pkg/cluster/sonobuoy/product.go b/pkg/cluster/sonobuoy/product.go index 565b0eb2a..003e945e1 100644 --- a/pkg/cluster/sonobuoy/product.go +++ b/pkg/cluster/sonobuoy/product.go @@ -4,7 +4,7 @@ package sonobuoy -import "github.com/siderolabs/talos/pkg/version" +import "github.com/siderolabs/talos/pkg/machinery/version" type product struct { Vendor string `yaml:"vendor"` diff --git a/pkg/cluster/support.go b/pkg/cluster/support.go index 8049b48f8..17bd9f724 100644 --- a/pkg/cluster/support.go +++ b/pkg/cluster/support.go @@ -33,12 +33,12 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" - "github.com/siderolabs/talos/pkg/cli" "github.com/siderolabs/talos/pkg/machinery/api/common" "github.com/siderolabs/talos/pkg/machinery/api/machine" "github.com/siderolabs/talos/pkg/machinery/client" "github.com/siderolabs/talos/pkg/machinery/constants" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/formatters" + "github.com/siderolabs/talos/pkg/machinery/version" ) // BundleOptions defines GetSupportBundle options. @@ -430,7 +430,7 @@ func serviceInfo(id string) collect { var buf bytes.Buffer - if err := cli.RenderServicesInfo(services, &buf, "", false); err != nil { + if err := formatters.RenderServicesInfo(services, &buf, "", false); err != nil { return nil, err } @@ -528,7 +528,7 @@ func dependencies(ctx context.Context, options *BundleOptions) ([]byte, error) { var buf bytes.Buffer - if err = cli.RenderGraph(ctx, options.Client, resp, &buf, true); err != nil { + if err = formatters.RenderGraph(ctx, options.Client, resp, &buf, true); err != nil { return nil, err } @@ -617,7 +617,7 @@ func mounts(ctx context.Context, options *BundleOptions) ([]byte, error) { var buf bytes.Buffer - if err = cli.RenderMounts(resp, &buf, nil); err != nil { + if err = formatters.RenderMounts(resp, &buf, nil); err != nil { return nil, err } diff --git a/pkg/imager/imager.go b/pkg/imager/imager.go index db1fad428..4b5528136 100644 --- a/pkg/imager/imager.go +++ b/pkg/imager/imager.go @@ -30,8 +30,8 @@ import ( "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/kernel" "github.com/siderolabs/talos/pkg/machinery/overlay" + "github.com/siderolabs/talos/pkg/machinery/version" "github.com/siderolabs/talos/pkg/reporter" - "github.com/siderolabs/talos/pkg/version" ) // Imager is an interface for image generation. diff --git a/pkg/images/images.go b/pkg/images/images.go index 9f36ce8fa..d0dd348e0 100644 --- a/pkg/images/images.go +++ b/pkg/images/images.go @@ -7,7 +7,7 @@ package images import ( "github.com/siderolabs/talos/pkg/machinery/gendata" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) var ( diff --git a/pkg/images/list.go b/pkg/images/list.go index 2473a56b2..93c9f2ea1 100644 --- a/pkg/images/list.go +++ b/pkg/images/list.go @@ -11,7 +11,7 @@ import ( "github.com/siderolabs/talos/pkg/machinery/config" "github.com/siderolabs/talos/pkg/machinery/constants" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) // Versions holds all the images (and their versions) that are used in Talos. diff --git a/pkg/cli/formatters.go b/pkg/machinery/formatters/formatters.go similarity index 98% rename from pkg/cli/formatters.go rename to pkg/machinery/formatters/formatters.go index eec4b3031..ed71bcd79 100644 --- a/pkg/cli/formatters.go +++ b/pkg/machinery/formatters/formatters.go @@ -2,7 +2,8 @@ // 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 cli +// Package formatters contains the API response formatters used in the CLI output. +package formatters import ( "context" diff --git a/pkg/machinery/go.mod b/pkg/machinery/go.mod index 17815df52..cb6d4c54d 100644 --- a/pkg/machinery/go.mod +++ b/pkg/machinery/go.mod @@ -11,6 +11,7 @@ require ( github.com/containerd/go-cni v1.1.9 github.com/cosi-project/runtime v0.4.0-alpha.9 github.com/dustin/go-humanize v1.0.1 + github.com/emicklei/dot v1.6.0 github.com/evanphx/json-patch v5.9.0+incompatible github.com/ghodss/yaml v1.0.0 github.com/hashicorp/go-multierror v1.1.1 @@ -42,6 +43,7 @@ require ( github.com/containernetworking/cni v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/gertd/go-pluralize v0.2.1 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a // indirect @@ -51,13 +53,13 @@ require ( github.com/mdlayher/genetlink v1.3.2 // indirect github.com/mdlayher/netlink v1.7.2 // indirect github.com/mdlayher/socket v0.4.1 // indirect - github.com/onsi/ginkgo/v2 v2.11.0 // indirect - github.com/onsi/gomega v1.27.8 // indirect + github.com/onsi/ginkgo/v2 v2.13.0 // indirect + github.com/onsi/gomega v1.29.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.18.0 // indirect golang.org/x/net v0.20.0 // indirect @@ -65,6 +67,7 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.16.1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/pkg/machinery/go.sum b/pkg/machinery/go.sum index 266d55b0e..edfce8645 100644 --- a/pkg/machinery/go.sum +++ b/pkg/machinery/go.sum @@ -30,6 +30,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/emicklei/dot v1.6.0 h1:vUzuoVE8ipzS7QkES4UfxdpCwdU2U97m2Pb2tQCoYRY= +github.com/emicklei/dot v1.6.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -38,8 +40,8 @@ github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlL github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -94,13 +96,13 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -146,8 +148,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -227,8 +229,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/version/osrelease.go b/pkg/machinery/version/osrelease.go similarity index 100% rename from pkg/version/osrelease.go rename to pkg/machinery/version/osrelease.go diff --git a/pkg/version/osrelease_test.go b/pkg/machinery/version/osrelease_test.go similarity index 94% rename from pkg/version/osrelease_test.go rename to pkg/machinery/version/osrelease_test.go index 7a407a1e3..ec5d04a77 100644 --- a/pkg/version/osrelease_test.go +++ b/pkg/machinery/version/osrelease_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/siderolabs/talos/pkg/version" + "github.com/siderolabs/talos/pkg/machinery/version" ) func TestOSRelease(t *testing.T) { diff --git a/pkg/version/version.go b/pkg/machinery/version/version.go similarity index 100% rename from pkg/version/version.go rename to pkg/machinery/version/version.go