Skip to content

Commit

Permalink
Remove development debug output
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily committed Apr 8, 2024
1 parent 85e77d8 commit a9f3f8c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 77 deletions.
46 changes: 0 additions & 46 deletions config.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions internal/agent/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ 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,
collector.StrictValidation(strictValidations), collector.NoLogs)
if err != nil {
return err
}
fmt.Printf("cc.Install = %+v\n", cc.Install)

return RunInstall(cc)
}
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 2 additions & 5 deletions pkg/action/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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 {
Expand All @@ -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
Expand Down
19 changes: 0 additions & 19 deletions pkg/config/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit a9f3f8c

Please sign in to comment.