mirror of
https://github.com/rancher/os.git
synced 2025-07-13 14:44:03 +00:00
Merge pull request #877 from joshwget/remove-boot-flag
Remove --boot flag in `ros config export`
This commit is contained in:
commit
56ae343b79
@ -64,10 +64,6 @@ func configSubcommands() []cli.Command {
|
|||||||
Name: "output, o",
|
Name: "output, o",
|
||||||
Usage: "File to which to save",
|
Usage: "File to which to save",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
|
||||||
Name: "boot, b",
|
|
||||||
Usage: "Include cloud-config provided at boot",
|
|
||||||
},
|
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "private, p",
|
Name: "private, p",
|
||||||
Usage: "Include the generated private keys",
|
Usage: "Include the generated private keys",
|
||||||
@ -257,7 +253,7 @@ func merge(c *cli.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func export(c *cli.Context) {
|
func export(c *cli.Context) {
|
||||||
content, err := config.Dump(c.Bool("boot"), c.Bool("private"), c.Bool("full"))
|
content, err := config.Dump(c.Bool("private"), c.Bool("full"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ func (c *CloudConfig) Merge(values map[interface{}]interface{}) (*CloudConfig, e
|
|||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Dump(boot, private, full bool) (string, error) {
|
func Dump(private, full bool) (string, error) {
|
||||||
var cfg *CloudConfig
|
var cfg *CloudConfig
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
@ -113,9 +113,6 @@ func Dump(boot, private, full bool) (string, error) {
|
|||||||
if !private {
|
if !private {
|
||||||
files = util.FilterStrings(files, func(x string) bool { return x != CloudConfigPrivateFile })
|
files = util.FilterStrings(files, func(x string) bool { return x != CloudConfigPrivateFile })
|
||||||
}
|
}
|
||||||
if !boot {
|
|
||||||
files = util.FilterStrings(files, func(x string) bool { return x != CloudConfigBootFile })
|
|
||||||
}
|
|
||||||
cfg, err = ChainCfgFuncs(nil,
|
cfg, err = ChainCfgFuncs(nil,
|
||||||
func(_ *CloudConfig) (*CloudConfig, error) { return ReadConfig(nil, true, files...) },
|
func(_ *CloudConfig) (*CloudConfig, error) { return ReadConfig(nil, true, files...) },
|
||||||
amendNils,
|
amendNils,
|
||||||
|
@ -204,7 +204,7 @@ func RunInit() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cfg.Rancher.Debug {
|
if cfg.Rancher.Debug {
|
||||||
cfgString, err := config.Dump(false, false, true)
|
cfgString, err := config.Dump(false, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithFields(log.Fields{"err": err}).Error("Error serializing config")
|
log.WithFields(log.Fields{"err": err}).Error("Error serializing config")
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user