mirror of
https://github.com/rancher/os.git
synced 2025-08-09 10:38:25 +00:00
Add prompt message to ros os upgrade
This commit is contained in:
parent
03deff471e
commit
24229f0dec
@ -164,7 +164,7 @@ func editSyslinux(c *cli.Context) error {
|
|||||||
return errors.New("raspberry pi can not use this command")
|
return errors.New("raspberry pi can not use this command")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat("/proc/1/root/boot/global.cfg"); os.IsNotExist(err) {
|
if isExist := checkGlobalCfg(); !isExist {
|
||||||
buf := bufio.NewWriter(os.Stdout)
|
buf := bufio.NewWriter(os.Stdout)
|
||||||
fmt.Fprintln(buf, "global.cfg can not be found")
|
fmt.Fprintln(buf, "global.cfg can not be found")
|
||||||
buf.Flush()
|
buf.Flush()
|
||||||
|
@ -185,6 +185,10 @@ func osUpgrade(c *cli.Context) error {
|
|||||||
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
|
log.Fatalf("ros install / upgrade only supported on 'amd64', not '%s'", runtime.GOARCH)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isExist := checkGlobalCfg(); !isExist {
|
||||||
|
log.Fatalf("ros upgrade cannot be supported")
|
||||||
|
}
|
||||||
|
|
||||||
image := c.String("image")
|
image := c.String("image")
|
||||||
|
|
||||||
if image == "" {
|
if image == "" {
|
||||||
|
@ -55,3 +55,11 @@ func symLinkEngineBinary(version string) []symlink {
|
|||||||
}
|
}
|
||||||
return baseSymlink
|
return baseSymlink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func checkGlobalCfg() bool {
|
||||||
|
_, err := os.Stat("/proc/1/root/boot/global.cfg")
|
||||||
|
if err == nil || os.IsExist(err) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user