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: update image to ubi8 and hello-world #1011

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions environment/container/dockerengine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestIsBuilderAvailable(t *testing.T) {

t.Run("normal use case", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "quay.io/konveyor/move2kube-api"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand All @@ -82,7 +82,7 @@ func TestIsBuilderAvailable(t *testing.T) {

t.Run("normal use case where we get result from cache", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "quay.io/konveyor/move2kube-api"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand All @@ -105,7 +105,7 @@ func TestIsBuilderAvailable(t *testing.T) {

t.Run("check for creating a container ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand All @@ -127,7 +127,7 @@ func TestIsBuilderAvailable(t *testing.T) {
testStderr := ""
testExitCode := 0
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"
if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
}
Expand All @@ -153,7 +153,7 @@ func TestIsBuilderAvailable(t *testing.T) {

t.Run("Check for InspectImage functionality ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"
if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
}
Expand All @@ -164,19 +164,19 @@ func TestIsBuilderAvailable(t *testing.T) {

found := false
for _, i := range outputInspect.RepoTags {
if strings.HasSuffix(i, "alpine:latest") {
if strings.HasSuffix(i, "ubi8-minimal:8.7-1107") {
found = true
}
}
if !found {
t.Fatalf("Ispect Repo Tag Mismatch Should be - alpine:latest got - %v", outputInspect.RepoTags)
t.Fatalf("Ispect Repo Tag Mismatch Should be - ubi8-minimal:8.7-1107 got - %v", outputInspect.RepoTags)
}

})

t.Run("check for stopping and removing a container ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand Down Expand Up @@ -204,16 +204,16 @@ func TestIsBuilderAvailable(t *testing.T) {
}
})

t.Run("check for coping directories to an image ", func(t *testing.T) {
t.Run("check for copying directories to an image ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
}

image = "alpine:latest"
newimage := "alpine:with_dirs"
image = "registry.access.redhat.com/ubi8-minimal:8.7-1107"
newimage := "registry.access.redhat.com/ubi8-minimal:with_dirs"
paths := make(map[string]string)
absDir1, err := filepath.Abs("./testdata/dirstocopy/dir1")
if err == nil {
Expand Down Expand Up @@ -270,9 +270,9 @@ func TestIsBuilderAvailable(t *testing.T) {
}

})
t.Run("check for coping directories to a container ", func(t *testing.T) {
t.Run("check for copying directories to a container ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand Down Expand Up @@ -338,9 +338,9 @@ func TestIsBuilderAvailable(t *testing.T) {
}
})

t.Run("check for coping directories from a container ", func(t *testing.T) {
t.Run("check for copying directories from a container ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"

if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
Expand Down Expand Up @@ -427,7 +427,7 @@ func TestIsBuilderAvailable(t *testing.T) {

t.Run("check for Stat of a file ", func(t *testing.T) {
provider, _ := newDockerEngine()
image := "docker.io/alpine:latest"
image := "registry.access.redhat.com/ubi8-minimal:8.7-1107"
if err := provider.pullImage(image); err != nil {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %q", image, err)
}
Expand Down
12 changes: 6 additions & 6 deletions environment/container/podmanengine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestPodman(t *testing.T) {

t.Run("normal use case", func(t *testing.T) {
provider := newPodmanEngine()
image := "quay.io/konveyor/move2kube-api"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); !err {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %v", image, err)
Expand All @@ -37,7 +37,7 @@ func TestPodman(t *testing.T) {

t.Run("normal use case where we get result from cache", func(t *testing.T) {
provider := newPodmanEngine()
image := "quay.io/konveyor/move2kube-api"
image := "quay.io/konveyor/hello-world:latest"

if err := provider.pullImage(image); !err {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %v", image, err)
Expand All @@ -60,7 +60,7 @@ func TestPodman(t *testing.T) {

t.Run("check for a running a container", func(t *testing.T) {
provider := newPodmanEngine()
image := "docker.io/alpine:latest"
image := "quay.io/konveyor/hello-world:latest"
if err := provider.pullImage(image); !err {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %v", image, err)
}
Expand All @@ -73,7 +73,7 @@ func TestPodman(t *testing.T) {

t.Run("Check for InspectImage functionality ", func(t *testing.T) {
provider := newPodmanEngine()
image := "docker.io/alpine:latest"
image := "quay.io/konveyor/hello-world:latest"
if err := provider.pullImage(image); !err {
t.Fatalf("Failed to find the image '%s' locally and/or pull it. Error: %v", image, err)
}
Expand All @@ -83,12 +83,12 @@ func TestPodman(t *testing.T) {
}
found := false
for _, i := range outputInspect.RepoTags {
if strings.HasSuffix(i, "alpine:latest") {
if strings.HasSuffix(i, "hello-world:latest") {
found = true
}
}
if !found {
t.Fatalf("Ispect Repo Tag Mismatch Should be - alpine:latest got - %+v", outputInspect)
t.Fatalf("Ispect Repo Tag Mismatch Should be - hello-world:latest got - %+v", outputInspect)
}
})
}