mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00
Remove development debug output
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
parent
0a3b0c0482
commit
d8df60c315
46
config.yaml
46
config.yaml
@ -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
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user