1
0
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 ()

This commit is contained in:
Itxaka 2023-05-18 16:23:18 +02:00 committed by GitHub
parent 8680b0ae93
commit f3d5965041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions
main.go
pkg/elementalConfig

View File

@ -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)
}

View File

@ -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(