Skip to content

Commit

Permalink
🐛 Fix errors when scanning container images
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Sep 18, 2023
1 parent 3abea0d commit 9a2b87e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion providers/os/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion providers/os/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 9a2b87e

Please sign in to comment.