fix(saas): Don't overwrite config.toml if UUID already set (#1180)

* fix(saas): Don't overwrite config.toml if UUID already set

* add a test case
This commit is contained in:
Kota Kanbe
2021-02-19 06:42:22 +09:00
committed by GitHub
parent aeaf308679
commit e3c27e1817
4 changed files with 459 additions and 121 deletions

View File

@@ -113,7 +113,7 @@ func (p *SaaSCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
}
// Ensure UUIDs of scan target servers in config.toml
if err := saas.EnsureUUIDs(p.configPath, res); err != nil {
if err := saas.EnsureUUIDs(c.Conf.Servers, p.configPath, res); err != nil {
util.Log.Errorf("Failed to ensure UUIDs. err: %+v", err)
return subcommands.ExitFailure
}