Skip to content

Commit b5faa9b

Browse files
authored
Merge pull request #1952 from saschagrunert/update-win-test-image-ltsc2022
Update Windows test image to use ltsc2022 base
2 parents e5b1a74 + 9900d2a commit b5faa9b

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

images/image-test-win/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM mcr.microsoft.com/windows/nanoserver:1809
15+
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
1616
ARG TEST
1717
ADD ${TEST} ${TEST}

test/e2e/inspect_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"fmt"
2323
"os"
24+
"strings"
2425

2526
. "github.com/onsi/ginkgo/v2"
2627
. "github.com/onsi/gomega"
@@ -55,7 +56,18 @@ var _ = t.Describe("inspect", func() {
5556

5657
AfterEach(func() {
5758
Expect(t.Crictl("rmp -f " + sandbox)).To(Exit(0))
58-
Expect(t.Crictl("rmi " + imageLatest)).To(Exit(0))
59+
60+
// Remove image by tag first
61+
t.Crictl("rmi " + imageLatest)
62+
63+
// Remove any remaining digest references for this image
64+
res := t.Crictl("images --filter reference=" + imageLatest + " -q")
65+
contents := res.Out.Contents()
66+
if len(contents) > 0 {
67+
output := strings.Split(string(contents), "\n")
68+
t.Crictl("rmi " + strings.TrimSpace(strings.Join(output, " ")))
69+
}
70+
5971
t.CrictlRemovePauseImages()
6072
})
6173

test/e2e/inspecti_test.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package e2e
1919
import (
2020
"encoding/json"
2121
"fmt"
22+
"strings"
2223

2324
. "github.com/onsi/ginkgo/v2"
2425
. "github.com/onsi/gomega"
@@ -39,7 +40,22 @@ var _ = t.Describe("inspecti", func() {
3940
})
4041

4142
AfterEach(func() {
42-
Expect(t.Crictl(fmt.Sprintf("rmi %s %s", image1, image2))).To(Exit(0))
43+
// Remove images by tag first
44+
t.Crictl(fmt.Sprintf("rmi %s %s", image1, image2))
45+
46+
// Remove any remaining digest references for these images
47+
res := t.Crictl("images --filter reference=" + image1 + " -q")
48+
contents := res.Out.Contents()
49+
if len(contents) > 0 {
50+
output := strings.Split(string(contents), "\n")
51+
t.Crictl("rmi " + strings.TrimSpace(strings.Join(output, " ")))
52+
}
53+
res = t.Crictl("images --filter reference=" + image2 + " -q")
54+
contents = res.Out.Contents()
55+
if len(contents) > 0 {
56+
output := strings.Split(string(contents), "\n")
57+
t.Crictl("rmi " + strings.TrimSpace(strings.Join(output, " ")))
58+
}
4359
})
4460

4561
It("should succeed", func() {

test/e2e/pull_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ var _ = t.Describe("pull", func() {
3434
)
3535

3636
AfterEach(func() {
37+
// Remove images by tag/digest first
3738
t.Crictl("rmi " + strings.Join([]string{image1, image2, image3}, " "))
39+
40+
// Remove any remaining digest references for test-image-1
41+
// Note: image1 and image2 both refer to test-image-1
42+
res := t.Crictl("images --filter reference=" + image1 + " -q")
43+
contents := res.Out.Contents()
44+
if len(contents) > 0 {
45+
output := strings.Split(string(contents), "\n")
46+
t.Crictl("rmi " + strings.TrimSpace(strings.Join(output, " ")))
47+
}
3848
})
3949

4050
It("should succeed without tag or digest", func() {

0 commit comments

Comments
 (0)