From d8df60c315c84bccf66b36bb1562d76a3f4be810 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Mon, 8 Apr 2024 12:51:35 +0300 Subject: [PATCH] Remove development debug output Signed-off-by: Dimitris Karakasilis --- config.yaml | 46 --------------------------------------- internal/agent/install.go | 7 ------ pkg/action/install.go | 7 ++---- pkg/config/spec.go | 19 ---------------- 4 files changed, 2 insertions(+), 77 deletions(-) delete mode 100644 config.yaml diff --git a/config.yaml b/config.yaml deleted file mode 100644 index f98d72d..0000000 --- a/config.yaml +++ /dev/null @@ -1,46 +0,0 @@ -#cloud-config - -strict: true -debug: true - -install: - no-format: true - auto: true - poweroff: false - reboot: false - grub_options: - extra_cmdline: "rd.immucore.debug" -users: - - name: "kairos" - passwd: "kairos" - -stages: - kairos-install.pre.before: - - if: '[ -e "/dev/vdb" ]' - name: "Create partitions" - commands: - - | - parted --script --machine -- "/dev/vdb" mklabel gpt - sgdisk --new=1:2048:+1M --change-name=1:'bios' --typecode=1:EF02 /dev/vdb # for grub - #parted --script "/dev/vdb" mkpart primary fat32 0 1MB - #mkfs.fat32 -L COS_GRUB /dev/vdb1 - layout: - device: - path: "/dev/vdb" - add_partitions: - - fsLabel: COS_OEM - size: 64 - pLabel: oem - - fsLabel: COS_RECOVERY - size: 8500 - pLabel: recovery - - fsLabel: COS_STATE - size: 18000 - pLabel: state - - fsLabel: COS_PERSISTENT - pLabel: persistent - size: 0 - filesystem: "ext4" - boot: - - systemd_firstboot: - keymap: us diff --git a/internal/agent/install.go b/internal/agent/install.go index 5aa57dd..afa0b9c 100644 --- a/internal/agent/install.go +++ b/internal/agent/install.go @@ -65,7 +65,6 @@ func ManualInstall(c, sourceImgURL, device string, reboot, poweroff, strictValid cliConf := generateInstallConfForCLIArgs(sourceImgURL) cliConfManualArgs := generateInstallConfForManualCLIArgs(device, reboot, poweroff) - fmt.Printf("configSource = %+v\n", configSource) cc, err := config.Scan(collector.Directories(configSource), collector.Readers(strings.NewReader(cliConf), strings.NewReader(cliConfManualArgs)), collector.MergeBootLine, @@ -73,7 +72,6 @@ func ManualInstall(c, sourceImgURL, device string, reboot, poweroff, strictValid if err != nil { return err } - fmt.Printf("cc.Install = %+v\n", cc.Install) return RunInstall(cc) } @@ -264,11 +262,6 @@ func runInstall(c *config.Config) error { return err } - // TODO: This should not be neccessary - fmt.Printf("!!!!!!!!!! installSpec.NoFormat = %+v\n", installSpec.NoFormat) - fmt.Printf("!!!!!!!!!! c.Install.NoFormat = %+v\n", c.Install.NoFormat) - //installSpec.NoFormat = c.Install.NoFormat - // Set our cloud-init to the file we just created f, err := dumpCCStringToFile(c) if err == nil { diff --git a/pkg/action/install.go b/pkg/action/install.go index ea0bbe4..84313c7 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -146,10 +146,9 @@ func (i InstallAction) Run() (err error) { // Check no-format flag if i.spec.NoFormat { - fmt.Println("!!!!!!!!!!!! won't format") + i.cfg.Logger.Infof("NoFormat is true, skipping format and partitioning") // Check force flag against current device labels := []string{i.spec.Active.Label, i.spec.Recovery.Label} - fmt.Printf("!!!! check active deployment = %+v\n", e.CheckActiveDeployment(labels)) if e.CheckActiveDeployment(labels) && !i.spec.Force { return fmt.Errorf("use `force` flag to run an installation over the current running deployment") } @@ -159,7 +158,7 @@ func (i InstallAction) Run() (err error) { if err != nil { return fmt.Errorf("no target device specified and no device found: %s", err) } - fmt.Printf("!!! device = %+v\n", device) + i.cfg.Logger.Infof("No target device specified, using pre-configured device: %s", device) i.spec.Target = device } } else { @@ -175,8 +174,6 @@ func (i InstallAction) Run() (err error) { } } - fmt.Printf("!!!!!!!!!!!! i.spec.Target = %+v\n", i.spec.Target) - err = e.MountPartitions(i.spec.Partitions.PartitionsByMountPoint(false)) if err != nil { return err diff --git a/pkg/config/spec.go b/pkg/config/spec.go index d9a511d..978661b 100644 --- a/pkg/config/spec.go +++ b/pkg/config/spec.go @@ -107,7 +107,6 @@ func NewInstallSpec(cfg *Config) (*v1.InstallSpec, error) { FS: constants.LinuxImgFs, Size: constants.ImgSize, } - fmt.Printf("!!!!!!!!!!!!!!! cfg.Install.Device = %+v\n", cfg.Install.Device) spec := &v1.InstallSpec{ Target: cfg.Install.Device, @@ -573,15 +572,9 @@ func ReadInstallSpecFromConfig(c *Config) (*v1.InstallSpec, error) { installSpec.Target = detectLargestDevice() } - fmt.Printf("installSpec before = %+v\n", installSpec) - fmt.Printf("c = %+v\n", c) if installSpec.NoFormat { installSpec.Target = "" } - fmt.Printf("installSpec after = %+v\n", installSpec) - - fmt.Printf("!!!!!()()()()()!!!! installSPec.Target = %+v\n", installSpec.Target) - fmt.Printf("!!!!!()()()()()!!!! c.Install.Device = %+v\n", c.Install.Device) // Workaround! // If we set the "auto" for the device in the cloudconfig the value will be proper in the Config.Install.Device @@ -591,21 +584,9 @@ func ReadInstallSpecFromConfig(c *Config) (*v1.InstallSpec, error) { // So instead we do the check here and override the installSpec.Target with the Config.Install.Device // as its the soonest we have access to both if installSpec.Target == "auto" { - // fmt.Printf("!!!!!!! installSpec.Target = %+v\n", installSpec.Target) - // fmt.Printf("!!!!!!! c.Install.Device = %+v\n", c.Install.Device) installSpec.Target = c.Install.Device } - // if installSpec.Target == "" { - // device, err := DetectPreConfiguredDevice(c.Logger) - // if err != nil { - // return installSpec, err - // } - // installSpec.Target = device - // } - - // fmt.Printf("!!!!!(after)()()()()!!!! installSPec.Target = %+v\n", installSpec.Target) - // fmt.Printf("!!!!!(after)()()()()!!!! c.Install.Device = %+v\n", c.Install.Device) return installSpec, nil }