Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Jan 13, 2024
1 parent 79a633c commit 91a38a8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions scripts/verify-bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path/filepath"

"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)
Expand Down Expand Up @@ -39,16 +40,14 @@ func createOrasContainer(ctx context.Context, regIP string, bundlePath string) t
reqOras := testcontainers.ContainerRequest{
Image: "bitnami/oras:latest",
Cmd: append([]string{"push", fmt.Sprintf("%s:5111/defsec-test:latest", regIP)}, OrasPush...),
Mounts: testcontainers.ContainerMounts{
testcontainers.ContainerMount{
Source: testcontainers.GenericBindMountSource{
HostPath: bundlePath,
},
Target: "/bundle.tar.gz",
},
},
HostConfigModifier: func(config *container.HostConfig) {
config.NetworkMode = "host"
config.Mounts = []mount.Mount{
{
Type: mount.TypeBind,
Source: bundlePath,
Target: "/bundle.tar.gz",
}}
},
WaitingFor: wait.ForLog("Pushed [registry] localhost:5111/defsec-test:latest"),
}
Expand Down

0 comments on commit 91a38a8

Please sign in to comment.