Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix errors when scanning container images #1772

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

czunker
Copy link
Contributor

@czunker czunker commented Sep 18, 2023

This fixes two errors:

cnquery run container registry gcr.io/mondoo-base-infra/mvd:latest -c "asset{ name platform ids kind runtime title }" --verbose     
Error: accepts 1 arg(s), received 2
...
x accepts 1 arg(s), received 2

This check was introduced with #1503

And

cnquery run container registry gcr.io/mondoo-base-infra/mvd:latest -c "asset{ name platform ids kind runtime title }" --verbose 
DBG using provider os with connector container
! using builtin provider for os
→ loaded configuration from /etc/opt/mondoo/mondoo.yml using source default
DBG found valid container registry reference ref=gcr.io/mondoo-base-infra/mvd:latest
! unknown credentials for container image
[
  {
    "type": "ssh_agent"
  }
]
...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x138f0a4]

goroutine 1 [running]:
go.mondoo.com/cnquery/providers/os/resources/discovery/container_registry.AuthOption({0xc00053f698?, 0x1, 0x1}, {0x0, 0x0})
	/home/christian/workspace/mondoo/github.com/cnquery/providers/os/resources/discovery/container_registry/resolver.go:113 +0xc4
go.mondoo.com/cnquery/providers/os/resources/discovery/container_registry.(*Resolver).Resolve(0xc000312fc0?, {0x10a000007?, 0x7?}, 0x0?, 0xc0003101e0, {0x0, 0x0})
	/home/christian/workspace/mondoo/github.com/cnquery/providers/os/resources/discovery/container_registry/resolver.go:54 +0x23a
go.mondoo.com/cnquery/providers/os/provider.(*Service).discover(0xc000610590?, 0xc0000fe900?)
	/home/christian/workspace/mondoo/github.com/cnquery/providers/os/provider/provider.go:446 +0x65

The ssh agent was introduced with #1735

Copy link
Member

@imilchev imilchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this and it's working well now! :shipit:

@czunker czunker merged commit 03484e0 into main Sep 18, 2023
@czunker czunker deleted the christian/fix_container_connection branch September 18, 2023 09:13
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants