mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-05-09 08:46:58 +00:00
✨ Allow adding extra cloud-init paths to run-stage (#27)
This commit is contained in:
parent
8680b0ae93
commit
f3d5965041
8
main.go
8
main.go
@ -498,6 +498,10 @@ The validate command expects a configuration file as its only argument. Local fi
|
||||
Name: "strict",
|
||||
Usage: "Enable strict mode. Fails and exits on stage errors",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "cloud-init-paths",
|
||||
Usage: "Extra paths to add to the run stage",
|
||||
},
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
if c.Args().Len() != 1 {
|
||||
@ -512,6 +516,10 @@ The validate command expects a configuration file as its only argument. Local fi
|
||||
cfg, err := elementalConfig.ReadConfigRun("/etc/elemental")
|
||||
cfg.Strict = c.Bool("strict")
|
||||
|
||||
if len(c.StringSlice("cloud-init-paths")) > 0 {
|
||||
cfg.CloudInitPaths = append(cfg.CloudInitPaths, c.StringSlice("cloud-init-paths")...)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
cfg.Logger.Errorf("Error reading config: %s\n", err)
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ func configLogger(log v1.Logger, vfs v1.FS) {
|
||||
}
|
||||
|
||||
v := common.GetVersion()
|
||||
log.Infof("Starting elemental version %s", v)
|
||||
log.Infof("kairos-agent version %s", v)
|
||||
}
|
||||
|
||||
var decodeHook = viper.DecodeHook(
|
||||
|
Loading…
Reference in New Issue
Block a user