1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Add swap support in cloud config mounts

This commit is contained in:
Josh Curl
2016-06-22 21:49:57 -07:00
parent b22c075b95
commit 128c228ff5
4 changed files with 45 additions and 2 deletions

View File

@@ -224,8 +224,16 @@ func executeCloudConfig() error {
log.Errorf("Unable to mount %s: must specify exactly four arguments", configMount[1])
}
device := util.ResolveDevice(configMount[0])
if configMount[2] == "swap" {
cmd := exec.Command("swapon", device)
err := cmd.Run()
if err != nil {
log.Errorf("Unable to swapon %s: %v", device, err)
}
continue
}
if err := mount.Mount(device, configMount[1], configMount[2], configMount[3]); err != nil {
log.Errorf("Unable to mount %s: %s", configMount[1], err)
log.Errorf("Unable to mount %s: %v", configMount[1], err)
}
}