From 3dd1f4e88c22734f03f7609791558b8bbbae3756 Mon Sep 17 00:00:00 2001 From: Artem Chernyshev Date: Mon, 15 Apr 2024 21:28:37 +0300 Subject: [PATCH] chore: extract `pkg/imager/quirks` to `pkg/machinery` To make it possible to use it without pulling the whole Talos. Signed-off-by: Artem Chernyshev --- cmd/installer/pkg/install/manifest.go | 2 +- .../app/machined/pkg/runtime/v1alpha1/bootloader/bootloader.go | 2 +- pkg/imager/imager.go | 2 +- pkg/imager/iso/grub.go | 2 +- pkg/imager/out.go | 2 +- pkg/imager/profile/input.go | 2 +- pkg/{ => machinery}/imager/quirks/quirks.go | 0 pkg/{ => machinery}/imager/quirks/quirks_test.go | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename pkg/{ => machinery}/imager/quirks/quirks.go (100%) rename pkg/{ => machinery}/imager/quirks/quirks_test.go (96%) diff --git a/cmd/installer/pkg/install/manifest.go b/cmd/installer/pkg/install/manifest.go index 5a9eb978f2..087e1fe58b 100644 --- a/cmd/installer/pkg/install/manifest.go +++ b/cmd/installer/pkg/install/manifest.go @@ -22,8 +22,8 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board" "github.com/siderolabs/talos/internal/pkg/mount" "github.com/siderolabs/talos/internal/pkg/partition" - "github.com/siderolabs/talos/pkg/imager/quirks" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" ) // Manifest represents the instructions for preparing all block devices diff --git a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/bootloader.go b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/bootloader.go index a4d8a556f0..4702a7fad1 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/bootloader/bootloader.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/bootloader/bootloader.go @@ -12,7 +12,7 @@ import ( "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/options" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/sdboot" - "github.com/siderolabs/talos/pkg/imager/quirks" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" ) // Bootloader describes a bootloader. diff --git a/pkg/imager/imager.go b/pkg/imager/imager.go index 9180b5001f..c5f7de380b 100644 --- a/pkg/imager/imager.go +++ b/pkg/imager/imager.go @@ -24,10 +24,10 @@ import ( "github.com/siderolabs/talos/pkg/imager/extensions" "github.com/siderolabs/talos/pkg/imager/overlay/executor" "github.com/siderolabs/talos/pkg/imager/profile" - "github.com/siderolabs/talos/pkg/imager/quirks" "github.com/siderolabs/talos/pkg/imager/utils" "github.com/siderolabs/talos/pkg/machinery/config/merge" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" "github.com/siderolabs/talos/pkg/machinery/kernel" "github.com/siderolabs/talos/pkg/machinery/overlay" "github.com/siderolabs/talos/pkg/machinery/version" diff --git a/pkg/imager/iso/grub.go b/pkg/imager/iso/grub.go index 1feec3a406..0e80e804b8 100644 --- a/pkg/imager/iso/grub.go +++ b/pkg/imager/iso/grub.go @@ -16,8 +16,8 @@ import ( "github.com/siderolabs/go-cmd/pkg/cmd" "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/bootloader/grub" - "github.com/siderolabs/talos/pkg/imager/quirks" "github.com/siderolabs/talos/pkg/imager/utils" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" ) // GRUBOptions described the input for the CreateGRUB function. diff --git a/pkg/imager/out.go b/pkg/imager/out.go index 7af7a11ea0..ce6004e798 100644 --- a/pkg/imager/out.go +++ b/pkg/imager/out.go @@ -33,9 +33,9 @@ import ( "github.com/siderolabs/talos/pkg/imager/ova" "github.com/siderolabs/talos/pkg/imager/profile" "github.com/siderolabs/talos/pkg/imager/qemuimg" - "github.com/siderolabs/talos/pkg/imager/quirks" "github.com/siderolabs/talos/pkg/imager/utils" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" "github.com/siderolabs/talos/pkg/reporter" ) diff --git a/pkg/imager/profile/input.go b/pkg/imager/profile/input.go index e8bdbced30..13b89cf80b 100644 --- a/pkg/imager/profile/input.go +++ b/pkg/imager/profile/input.go @@ -26,9 +26,9 @@ import ( "github.com/siderolabs/talos/pkg/imager/profile/internal/signer/aws" "github.com/siderolabs/talos/pkg/imager/profile/internal/signer/azure" "github.com/siderolabs/talos/pkg/imager/profile/internal/signer/file" - "github.com/siderolabs/talos/pkg/imager/quirks" "github.com/siderolabs/talos/pkg/images" "github.com/siderolabs/talos/pkg/machinery/constants" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" ) const ( diff --git a/pkg/imager/quirks/quirks.go b/pkg/machinery/imager/quirks/quirks.go similarity index 100% rename from pkg/imager/quirks/quirks.go rename to pkg/machinery/imager/quirks/quirks.go diff --git a/pkg/imager/quirks/quirks_test.go b/pkg/machinery/imager/quirks/quirks_test.go similarity index 96% rename from pkg/imager/quirks/quirks_test.go rename to pkg/machinery/imager/quirks/quirks_test.go index f55f3a925b..a5fc1d75f4 100644 --- a/pkg/imager/quirks/quirks_test.go +++ b/pkg/machinery/imager/quirks/quirks_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/siderolabs/talos/pkg/imager/quirks" + "github.com/siderolabs/talos/pkg/machinery/imager/quirks" ) func TestSupportsResetOption(t *testing.T) {