@@ -2,7 +2,6 @@ package node
22
33import (
44 "context"
5- "fmt"
65 "time"
76
87 g "github.com/onsi/ginkgo/v2"
@@ -13,35 +12,19 @@ import (
1312 e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
1413
1514 exutil "github.com/openshift/origin/test/extended/util"
15+ "github.com/openshift/origin/test/extended/util/image"
1616)
1717
18- var _ = g .Describe ("[sig-builds][sig- node][Feature:Builds][apigroup:build.openshift.io ] zstd:chunked Image" , func () {
18+ var _ = g .Describe ("[sig-node] zstd:chunked Image" , func () {
1919 defer g .GinkgoRecover ()
2020 var (
21- oc = exutil .NewCLI ("zstd-chunked-image" )
22- customBuildAdd = exutil .FixturePath ("testdata" , "node" , "zstd-chunked" )
23- customBuildFixture = exutil .FixturePath ("testdata" , "node" , "zstd-chunked" , "test-custom-build.yaml" )
21+ oc = exutil .NewCLI ("zstd-chunked-image" )
2422 )
2523
2624 g .It ("should successfully run date command" , func (ctx context.Context ) {
2725 namespace := oc .Namespace ()
2826
29- g .By ("creating custom builder image" )
30- // Build with buildah with --compression-format zstd:chunked to ensure the image is compressed with zstd:chunked.
31- // https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/builds_using_buildconfig/custom-builds-buildah#builds-build-custom-builder-image_custom-builds-buildah
32- err := oc .Run ("new-build" ).Args ("--binary" , "--strategy=docker" , "--name=custom-builder-image" ).Execute ()
33- o .Expect (err ).NotTo (o .HaveOccurred ())
34- br , _ := exutil .StartBuildAndWait (oc , "custom-builder-image" , fmt .Sprintf ("--from-dir=%s" , customBuildAdd ))
35- br .AssertSuccess ()
36- g .By ("start custom build and build should complete" )
37- err = oc .AsAdmin ().Run ("create" ).Args ("-f" , customBuildFixture ).Execute ()
38- o .Expect (err ).NotTo (o .HaveOccurred ())
39- err = oc .AsAdmin ().Run ("start-build" ).Args ("sample-custom-build" ).Execute ()
40- o .Expect (err ).NotTo (o .HaveOccurred ())
41- err = exutil .WaitForABuild (oc .BuildClient ().BuildV1 ().Builds (oc .Namespace ()), "sample-custom-build-1" , nil , nil , nil )
42- o .Expect (err ).NotTo (o .HaveOccurred ())
43-
44- // Define a pod that runs the date command using the zstd-chunked image
27+ // Define a pod that runs the date command using a prebuilt zstd:chunked image
4528 pod := & corev1.Pod {
4629 ObjectMeta : metav1.ObjectMeta {
4730 Name : "zstd-chunked-pod" ,
@@ -52,14 +35,15 @@ var _ = g.Describe("[sig-builds][sig-node][Feature:Builds][apigroup:build.opensh
5235 Containers : []corev1.Container {
5336 {
5437 Name : "zstd-chunked-container" ,
55- Image : fmt . Sprintf ( "image-registry.openshift-image-registry.svc:5000/%s/sample-custom:latest" , namespace ),
38+ Image : image . LocationFor ( "quay.io/crio/zstd-chunked:1" ),
5639 Command : []string {"date" },
5740 },
5841 },
5942 },
6043 }
6144
62- g .By ("Creating a pod" )
45+ g .By ("Creating a pod with prebuilt zstd:chunked image" )
46+ var err error
6347 pod , err = oc .KubeClient ().CoreV1 ().Pods (namespace ).Create (context .Background (), pod , metav1.CreateOptions {})
6448 o .Expect (err ).NotTo (o .HaveOccurred ())
6549
0 commit comments