diff --git a/providers/os/config/config.go b/providers/os/config/config.go index 23e6046637..b111ac0871 100644 --- a/providers/os/config/config.go +++ b/providers/os/config/config.go @@ -168,7 +168,7 @@ var Config = plugin.Provider{ Use: "container", Short: "a running container or container image", MinArgs: 1, - MaxArgs: 1, + MaxArgs: 2, Discovery: []string{ "containers", "container-images", diff --git a/providers/os/provider/provider.go b/providers/os/provider/provider.go index f51ff9f9af..2655c530ce 100644 --- a/providers/os/provider/provider.go +++ b/providers/os/provider/provider.go @@ -143,7 +143,9 @@ func (s *Service) ParseCLI(req *plugin.ParseCLIReq) (*plugin.ParseCLIRes, error) conf.Path = string(x.Value) } - conf.Credentials = append(conf.Credentials, &vault.Credential{Type: vault.CredentialType_ssh_agent, User: user}) + if user != "" { + conf.Credentials = append(conf.Credentials, &vault.Credential{Type: vault.CredentialType_ssh_agent, User: user}) + } asset := &inventory.Asset{ Connections: []*inventory.Config{conf},