mirror of
https://github.com/rancher/os.git
synced 2025-08-11 19:42:24 +00:00
Merge pull request #1641 from rancher/silence-empty-cloud-init-warning-on-upgrade
Don't complain if there is no cloud-config supplied when upgrading
This commit is contained in:
commit
30534a617b
@ -113,6 +113,7 @@ func installAction(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
if installType == "rancher-upgrade" ||
|
if installType == "rancher-upgrade" ||
|
||||||
installType == "upgrade" {
|
installType == "upgrade" {
|
||||||
|
installType = "upgrade" // rancher-upgrade is redundant!
|
||||||
force = true // the os.go upgrade code already asks
|
force = true // the os.go upgrade code already asks
|
||||||
reboot = false
|
reboot = false
|
||||||
isoinstallerloaded = true // OMG this flag is aweful - kill it with fire
|
isoinstallerloaded = true // OMG this flag is aweful - kill it with fire
|
||||||
@ -121,8 +122,7 @@ func installAction(c *cli.Context) error {
|
|||||||
if installType != "noformat" &&
|
if installType != "noformat" &&
|
||||||
installType != "raid" &&
|
installType != "raid" &&
|
||||||
installType != "bootstrap" &&
|
installType != "bootstrap" &&
|
||||||
installType != "upgrade" &&
|
installType != "upgrade" {
|
||||||
installType != "rancher-upgrade" {
|
|
||||||
// These can use RANCHER_BOOT or RANCHER_STATE labels..
|
// These can use RANCHER_BOOT or RANCHER_STATE labels..
|
||||||
if device == "" {
|
if device == "" {
|
||||||
log.Fatal("Can not proceed without -d <dev> specified")
|
log.Fatal("Can not proceed without -d <dev> specified")
|
||||||
@ -131,7 +131,10 @@ func installAction(c *cli.Context) error {
|
|||||||
|
|
||||||
cloudConfig := c.String("cloud-config")
|
cloudConfig := c.String("cloud-config")
|
||||||
if cloudConfig == "" {
|
if cloudConfig == "" {
|
||||||
|
if installType != "upgrade" {
|
||||||
|
// TODO: I wonder if its plausible to merge a new cloud-config into an existing one on upgrade - so for now, i'm only turning off the warning
|
||||||
log.Warn("Cloud-config not provided: you might need to provide cloud-config on bootDir with ssh_authorized_keys")
|
log.Warn("Cloud-config not provided: you might need to provide cloud-config on bootDir with ssh_authorized_keys")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uc := "/opt/user_config.yml"
|
uc := "/opt/user_config.yml"
|
||||||
if err := util.FileCopy(cloudConfig, uc); err != nil {
|
if err := util.FileCopy(cloudConfig, uc); err != nil {
|
||||||
@ -302,8 +305,7 @@ func runInstall(image, installType, cloudConfig, device, kappend string, force,
|
|||||||
device = "/host" + device
|
device = "/host" + device
|
||||||
}
|
}
|
||||||
|
|
||||||
if installType == "rancher-upgrade" ||
|
if installType == "upgrade" {
|
||||||
installType == "upgrade" {
|
|
||||||
isoinstallerloaded = false
|
isoinstallerloaded = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,7 +385,7 @@ func mountBootIso() error {
|
|||||||
|
|
||||||
func layDownOS(image, installType, cloudConfig, device, kappend string, kexec bool) error {
|
func layDownOS(image, installType, cloudConfig, device, kappend string, kexec bool) error {
|
||||||
// ENV == installType
|
// ENV == installType
|
||||||
//[[ "$ARCH" == "arm" && "$ENV" != "rancher-upgrade" ]] && ENV=arm
|
//[[ "$ARCH" == "arm" && "$ENV" != "upgrade" ]] && ENV=arm
|
||||||
|
|
||||||
// image == rancher/os:v0.7.0_arm
|
// image == rancher/os:v0.7.0_arm
|
||||||
// TODO: remove the _arm suffix (but watch out, its not always there..)
|
// TODO: remove the _arm suffix (but watch out, its not always there..)
|
||||||
@ -483,9 +485,10 @@ func layDownOS(image, installType, cloudConfig, device, kappend string, kexec bo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
kernelArgs = kernelArgs + " rancher.cloud_init.datasources=[ec2,gce]"
|
kernelArgs = kernelArgs + " rancher.cloud_init.datasources=[ec2,gce]"
|
||||||
case "upgrade":
|
|
||||||
fallthrough
|
|
||||||
case "rancher-upgrade":
|
case "rancher-upgrade":
|
||||||
|
installType = "upgrade" // rancher-upgrade is redundant
|
||||||
|
fallthrough
|
||||||
|
case "upgrade":
|
||||||
var err error
|
var err error
|
||||||
device, partition, err = mountdevice(baseName, bootDir, partition, false)
|
device, partition, err = mountdevice(baseName, bootDir, partition, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -196,7 +196,7 @@ func osVersion(c *cli.Context) error {
|
|||||||
|
|
||||||
func startUpgradeContainer(image string, stage, force, reboot, kexec bool, upgradeConsole bool, kernelArgs string) error {
|
func startUpgradeContainer(image string, stage, force, reboot, kexec bool, upgradeConsole bool, kernelArgs string) error {
|
||||||
command := []string{
|
command := []string{
|
||||||
"-t", "rancher-upgrade",
|
"-t", "upgrade",
|
||||||
"-r", config.Version,
|
"-r", config.Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user