mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-01 01:03:52 +00:00
✨ Allow adding extra cloud-init paths to run-stage (#27)
This commit is contained in:
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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user