Skip to content

Commit

Permalink
Prevent AWS from taking over the 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 19, 2023
1 parent 95be17b commit cb535f1
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions providers/aws/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ import (
"go.mondoo.com/cnquery/providers-sdk/v1/upstream"
"go.mondoo.com/cnquery/providers/aws/connection"
"go.mondoo.com/cnquery/providers/aws/resources"
osconnection "go.mondoo.com/cnquery/providers/os/connection"
"go.mondoo.com/cnquery/providers/os/connection/shared"
"go.mondoo.com/cnquery/providers/os/detector"
)

const (
defaultConnection uint32 = 1
DefaultConnectionType = "aws"
SshConnectionType = "ssh"
RegistryImageConnectionType = "registry-image"
defaultConnection uint32 = 1
DefaultConnectionType = "aws"
)

type Service struct {
Expand Down Expand Up @@ -134,20 +130,9 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
var err error

switch conf.Type {
case SshConnectionType:
s.lastConnectionID++
conn, err = osconnection.NewSshConnection(s.lastConnectionID, conf, asset)
if pf, ok := detector.DetectOS(conn); ok {
conn.Asset().Platform = pf
}

case RegistryImageConnectionType:
s.lastConnectionID++
conn, err = osconnection.NewContainerRegistryImage(s.lastConnectionID, conf, asset)
default:
s.lastConnectionID++
conn, err = connection.NewAwsConnection(s.lastConnectionID, asset, conf)

}
if err != nil {
return nil, err
Expand Down

0 comments on commit cb535f1

Please sign in to comment.