From a2fb0571ca77a07b429058c823c0998a1c991cf9 Mon Sep 17 00:00:00 2001 From: Hank Donnay Date: Wed, 24 Jan 2024 15:21:23 -0600 Subject: [PATCH] dockerfile: port to txtar & script tests Signed-off-by: Hank Donnay --- go.mod | 5 +- go.sum | 9 ++ rhel/dockerfile/dockerfile_test.go | 124 +++++++++++++----- .../{Dockerfile-Comments => Comments.txtar} | 6 + .../testdata/Dockerfile-Comments.want | 4 - .../testdata/Dockerfile-InvalidLabel | 2 - .../testdata/Dockerfile-InvalidLabel.want | 4 - .../testdata/Dockerfile-InvalidLabel.want.err | 1 - .../testdata/Dockerfile-etcd-rhel7.want | 15 --- .../testdata/Dockerfile-issue526.want | 3 - .../testdata/Dockerfile-nodejs10.want | 20 --- .../Dockerfile-quay-quay-rhel8-v3.5.6-4.want | 21 --- ...e-rhscl-redis-5-rhel7-5-53.1634738116.want | 23 ---- ...Dockerfile-rhscl-s2i-core-rhel7-1-235.want | 21 --- .../testdata/Dockerfile-ubi7-7.9-516.want | 20 --- .../Dockerfile-ubi8-minimal-8.4-208.want | 22 ---- rhel/dockerfile/testdata/InvalidLabel.txtar | 6 + .../{Dockerfile-issue526 => Issue526.txtar} | 5 + ...Dockerfile-etcd-rhel7 => etcd-rhel7.txtar} | 18 ++- .../{Dockerfile-nodejs10 => nodejs10.txtar} | 22 ++++ ...3.5.6-4 => quay-quay-rhel8-v3.5.6-4.txtar} | 23 ++++ ...rhscl-redis-5-rhel7-5-53.1634738116.txtar} | 25 ++++ ...1-235 => rhscl-s2i-core-rhel7-1-235.txtar} | 23 ++++ ...Dockerfile-ubi7-7.9-516 => ubi7-7.9.txtar} | 22 ++++ ...mal-8.4-208 => ubi8-minimal-8.4-208.txtar} | 78 +++++++---- 25 files changed, 302 insertions(+), 220 deletions(-) rename rhel/dockerfile/testdata/{Dockerfile-Comments => Comments.txtar} (76%) delete mode 100644 rhel/dockerfile/testdata/Dockerfile-Comments.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-InvalidLabel delete mode 100644 rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want.err delete mode 100644 rhel/dockerfile/testdata/Dockerfile-etcd-rhel7.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-issue526.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-nodejs10.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516.want delete mode 100644 rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208.want create mode 100644 rhel/dockerfile/testdata/InvalidLabel.txtar rename rhel/dockerfile/testdata/{Dockerfile-issue526 => Issue526.txtar} (52%) rename rhel/dockerfile/testdata/{Dockerfile-etcd-rhel7 => etcd-rhel7.txtar} (60%) rename rhel/dockerfile/testdata/{Dockerfile-nodejs10 => nodejs10.txtar} (64%) rename rhel/dockerfile/testdata/{Dockerfile-quay-quay-rhel8-v3.5.6-4 => quay-quay-rhel8-v3.5.6-4.txtar} (87%) rename rhel/dockerfile/testdata/{Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116 => rhscl-redis-5-rhel7-5-53.1634738116.txtar} (64%) rename rhel/dockerfile/testdata/{Dockerfile-rhscl-s2i-core-rhel7-1-235 => rhscl-s2i-core-rhel7-1-235.txtar} (74%) rename rhel/dockerfile/testdata/{Dockerfile-ubi7-7.9-516 => ubi7-7.9.txtar} (54%) rename rhel/dockerfile/testdata/{Dockerfile-ubi8-minimal-8.4-208 => ubi8-minimal-8.4-208.txtar} (54%) diff --git a/go.mod b/go.mod index eaeff3d60..7ed36c2d9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/quay/claircore -go 1.20 +go 1.22 + +toolchain go1.22rc2 require ( github.com/Masterminds/semver v1.5.0 @@ -32,6 +34,7 @@ require ( golang.org/x/time v0.4.0 golang.org/x/tools v0.17.0 modernc.org/sqlite v1.28.0 + rsc.io/script v0.0.1 ) require ( diff --git a/go.sum b/go.sum index 8b1035b45..340ee208b 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,7 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -134,6 +135,7 @@ github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peK github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -188,6 +190,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -324,7 +327,9 @@ modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/libc v1.29.0 h1:tTFRFq69YKCF2QyGNuRUQxKBm1uZZLubf6Cjh/pVHXs= modernc.org/libc v1.29.0/go.mod h1:DaG/4Q3LRRdqpiLyP0C2m1B8ZMGkQ+cCgOIjEtQlYhQ= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= @@ -338,6 +343,10 @@ modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0 modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= +rsc.io/script v0.0.1 h1:t8dtrXAUACmR2OV0OXuQ9otT/5x2F/QqsnssYhtcziM= +rsc.io/script v0.0.1/go.mod h1:CQ30lgzFbVimcUVFHfewSNOAv0ag6UQ0b0nIWeN22Fc= diff --git a/rhel/dockerfile/dockerfile_test.go b/rhel/dockerfile/dockerfile_test.go index 419c19eae..cb49e4865 100644 --- a/rhel/dockerfile/dockerfile_test.go +++ b/rhel/dockerfile/dockerfile_test.go @@ -1,70 +1,124 @@ package dockerfile import ( + "bufio" "bytes" "context" "encoding/json" - "io/fs" + "errors" + "fmt" "os" + "path/filepath" "strings" "testing" "github.com/google/go-cmp/cmp" + "golang.org/x/tools/txtar" + "rsc.io/script" + "rsc.io/script/scripttest" ) func TestGetLabels(t *testing.T) { ctx := context.Background() - td := os.DirFS("testdata") - de, err := fs.ReadDir(td, ".") + e := script.NewEngine() + e.Cmds = scripttest.DefaultCmds() + e.Conds = scripttest.DefaultConds() + e.Cmds["GetLabels"] = CmdGetLabels + const defaultScript = `# Check for expected JSON output. +GetLabels +cmp Got Want +` + + ms, err := filepath.Glob("testdata/*.txtar") if err != nil { t.Fatal(err) } - for _, de := range de { - n := de.Name() - if !strings.HasPrefix(n, "Dockerfile") || - strings.HasSuffix(n, ".want") || - strings.HasSuffix(n, ".want.err") { - continue - } - t.Run(n, func(t *testing.T) { - f, err := td.Open(n) + for _, m := range ms { + t.Run(strings.TrimSuffix(filepath.Base(m), filepath.Ext(m)), func(t *testing.T) { + ar, err := txtar.ParseFile(m) if err != nil { - t.Fatal(err) + t.Fatalf("error parsing %q: %v", m, err) } - defer f.Close() - w, err := td.Open(n + ".want") + wd := t.TempDir() + s, err := script.NewState(ctx, wd, nil) if err != nil { - t.Fatal(err) + t.Fatalf("error constructing *State: %v", err) } - defer w.Close() - wantErr, _ := fs.ReadFile(td, n+".want.err") - - want := make(map[string]string) - if err := json.NewDecoder(w).Decode(&want); err != nil { - t.Error(err) + if err := s.ExtractFiles(ar); err != nil { + t.Fatalf("error with ExtractFiles: %v", err) } - got, err := GetLabels(ctx, f) - if len(wantErr) == 0 { - if err != nil { + log := new(strings.Builder) + defer func() { + if err := s.CloseAndWait(log); err != nil { t.Error(err) } - } else { - if err == nil { - t.Error("got nil, wanted error") - } else { - if got, want := err.Error(), string(bytes.TrimSpace(wantErr)); got != want { - t.Errorf("got: %+#q, want: %+#q", got, want) - } + if log.Len() > 0 { + t.Log(strings.TrimSuffix(log.String(), "\n")) } + }() + sr := bytes.NewBuffer(ar.Comment) + if sr.Len() == 0 { + m = "(default script)" + sr = bytes.NewBufferString(defaultScript) } - - if !cmp.Equal(got, want) { - t.Error(cmp.Diff(got, want)) + if err := e.Execute(s, m, bufio.NewReader(sr), log); err != nil { + t.Error(err) } }) } } +var CmdGetLabels = script.Command( + script.CmdUsage{ + Summary: "parse a Dockerfile and return the labels of the named files", + Args: "[input]", + Detail: []string{ + "If a filename is not given, 'Dockerfile' is assumed.", + "The result is JSON-encoded with indents of two spaces and written to the file 'Got'.", + "If there's an error, it is printed to stderr.", + }, + }, + func(s *script.State, args ...string) (script.WaitFunc, error) { + name := "Dockerfile" + switch len(args) { + case 0: + case 1: + name = args[0] + default: + return nil, errors.New("bad number of arguments: want at most 1") + } + + in, err := os.Open(filepath.Join(s.Getwd(), name)) + if err != nil { + return nil, err + } + out, err := os.Create(filepath.Join(s.Getwd(), "Got")) + if err != nil { + in.Close() + return nil, err + } + enc := json.NewEncoder(out) + enc.SetEscapeHTML(false) + enc.SetIndent("", " ") + + return func(s *script.State) (stdout, stderr string, err error) { + defer in.Close() + defer out.Close() + var got map[string]string + got, err = GetLabels(s.Context(), in) + if err == nil { + if encErr := enc.Encode(got); encErr != nil { + err = fmt.Errorf("json error: %w", encErr) + } + } else { + stderr = err.Error() + "\n" + err = errors.New("GetLabels failed") + } + return + }, nil + }, +) + func TestSplit(t *testing.T) { for _, p := range []struct { In string diff --git a/rhel/dockerfile/testdata/Dockerfile-Comments b/rhel/dockerfile/testdata/Comments.txtar similarity index 76% rename from rhel/dockerfile/testdata/Dockerfile-Comments rename to rhel/dockerfile/testdata/Comments.txtar index c49db4575..38b6c4373 100644 --- a/rhel/dockerfile/testdata/Dockerfile-Comments +++ b/rhel/dockerfile/testdata/Comments.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- # Normal comments are fine FROM scratch @@ -7,3 +8,8 @@ LABEL \ C=D # This comment is stripped despite the apparent continuation +-- Want -- +{ + "A": "B", + "C": "D" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-Comments.want b/rhel/dockerfile/testdata/Dockerfile-Comments.want deleted file mode 100644 index 6a87d4ec9..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-Comments.want +++ /dev/null @@ -1,4 +0,0 @@ -{ - "A": "B", - "C": "D" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel b/rhel/dockerfile/testdata/Dockerfile-InvalidLabel deleted file mode 100644 index aac0f91bf..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel +++ /dev/null @@ -1,2 +0,0 @@ -LABEL A=B \ - C=D # Comments not allowed in this position diff --git a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want b/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want deleted file mode 100644 index 6a87d4ec9..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want +++ /dev/null @@ -1,4 +0,0 @@ -{ - "A": "B", - "C": "D" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want.err b/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want.err deleted file mode 100644 index cd81a4f82..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-InvalidLabel.want.err +++ /dev/null @@ -1 +0,0 @@ -invalid assignment syntax: `A=B C=D # Comments not allowed in this position` diff --git a/rhel/dockerfile/testdata/Dockerfile-etcd-rhel7.want b/rhel/dockerfile/testdata/Dockerfile-etcd-rhel7.want deleted file mode 100644 index 81fc0db41..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-etcd-rhel7.want +++ /dev/null @@ -1,15 +0,0 @@ -{ - "com.redhat.component": "etcd-container", - "description": "etcd is a distributed reliable key-value store for the most critical data of a distributed system.", - "install": "/usr/bin/docker run --rm $OPT1 --privileged -v /:/host -e HOST=/host -e NAME=$NAME -e IMAGE=$IMAGE $IMAGE $OPT2 /usr/bin/install.sh $OPT3", - "io.k8s.description": "etcd is a distributed reliable key-value store for the most critical data of a distributed system.", - "io.k8s.display-name": "etcd", - "io.openshift.expose-services": "2379:tcp,2380:tcp", - "io.openshift.tags": "etcd", - "name": "rhel7/etcd", - "run": "/usr/bin/docker run -d $OPT1 -p 4001:4001 -p 7001:7001 -p 2379:2379 -p 2380:2380 --name $NAME $IMAGE $OPT2 $OPT3", - "summary": "A highly-available key value store for shared configuration", - "uninstall": "/usr/bin/docker run --rm $OPT1 --privileged -v /:/host -e HOST=/host -e NAME=$NAME -e IMAGE=$IMAGE $IMAGE $OPT2 /usr/bin/uninstall.sh $OPT3", - "usage": "etcd -help ", - "version": "3.2.32" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-issue526.want b/rhel/dockerfile/testdata/Dockerfile-issue526.want deleted file mode 100644 index f702dd2d5..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-issue526.want +++ /dev/null @@ -1,3 +0,0 @@ -{ - "label": "B C E" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-nodejs10.want b/rhel/dockerfile/testdata/Dockerfile-nodejs10.want deleted file mode 100644 index 476bdb249..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-nodejs10.want +++ /dev/null @@ -1,20 +0,0 @@ -{ - "com.redhat.component": "nodejs-10-container", - "com.redhat.deployments-dir": "/src", - "com.redhat.dev-mode": "DEV_MODE:false", - "com.redhat.dev-mode.port": "DEBUG_PORT:5858", - "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", - "description": "Node.js 10 available as container is a base platform for building and running various Node.js 10 applications and frameworks. Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.", - "help": "For more information visit https://github.com/sclorg/s2i-nodejs-container", - "io.k8s.description": "Node.js 10 available as container is a base platform for building and running various Node.js 10 applications and frameworks. Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.", - "io.k8s.display-name": "Node.js 10", - "io.openshift.expose-services": "8080:http", - "io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i", - "io.openshift.tags": "builder,nodejs,nodejs10", - "io.s2i.scripts-url": "image:///usr/libexec/s2i", - "maintainer": "SoftwareCollections.org ", - "name": "ubi8/10", - "summary": "Platform for building and running Node.js 10 applications", - "usage": "s2i build ubi8/10:latest ", - "version": "1" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4.want b/rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4.want deleted file mode 100644 index 4bd0587b1..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4.want +++ /dev/null @@ -1,21 +0,0 @@ -{ - "com.redhat.component": "quay-registry-container", - "name": "quay/quay-rhel8", - "version": "v3.5.6", - "io.k8s.display-name": "Red Hat Quay", - "io.k8s.description": "Red Hat Quay", - "summary": "Red Hat Quay", - "maintainer": "support@redhat.com", - "io.openshift.tags": "quay", - "release": "4", - "com.redhat.license_terms": "https://www.redhat.com/agreements", - "distribution-scope": "public", - "vendor": "Red Hat, Inc.", - "build-date": "2021-08-17T21:16:14.144538", - "architecture": "x86_64", - "vcs-type": "git", - "vcs-ref": "0e033c625b6a775f5be730ce5a938aa91cc46d29", - "com.redhat.build-host": "example.com", - "description": "Red Hat Quay", - "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/quay/quay-rhel8/images/v3.5.6-4" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116.want b/rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116.want deleted file mode 100644 index 79ea68de6..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116.want +++ /dev/null @@ -1,23 +0,0 @@ -{ - "architecture": "x86_64", - "build-date": "2021-10-20T13:56:03.899740", - "com.redhat.build-host": "cpt-1007.osbs.prod.upshift.rdu2.redhat.com", - "com.redhat.component": "rh-redis5-container", - "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel", - "description": "Redis 5 available as container, is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log.", - "distribution-scope": "public", - "io.k8s.description": "Redis 5 available as container, is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log.", - "io.k8s.display-name": "Redis 5", - "io.openshift.expose-services": "6379:redis", - "io.openshift.tags": "database,redis,redis5,rh-redis5", - "maintainer": "SoftwareCollections.org ", - "name": "rhscl/redis-5-rhel7", - "release": "53.1634738116", - "summary": "Redis in-memory data structure store, used as database, cache and message broker", - "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/redis-5-rhel7/images/5-53.1634738116", - "usage": "podman run -d --name redis_database -p 6379:6379 rhscl/redis-5-rhel7", - "vcs-ref": "1ca08b535089c4828147120ead2699d9f237260a", - "vcs-type": "git", - "vendor": "Red Hat, Inc.", - "version": "5" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235.want b/rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235.want deleted file mode 100644 index 05be1b3da..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235.want +++ /dev/null @@ -1,21 +0,0 @@ -{ - "architecture": "x86_64", - "build-date": "2021-10-06T13:08:17.304497", - "com.redhat.build-host": "cpt-1005.osbs.prod.upshift.rdu2.redhat.com", - "com.redhat.component": "s2i-core-container", - "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", - "description": "The s2i-core image provides any images layered on top of it with all the tools needed to use source-to-image functionality while keeping the image size as small as possible.", - "distribution-scope": "public", - "io.k8s.description": "The s2i-core image provides any images layered on top of it with all the tools needed to use source-to-image functionality while keeping the image size as small as possible.", - "io.k8s.display-name": "s2i core", - "io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i", - "io.s2i.scripts-url": "image:///usr/libexec/s2i", - "name": "rhscl/s2i-core-rhel7", - "release": "235", - "summary": "Base image which allows using of source-to-image.", - "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/s2i-core-rhel7/images/1-235", - "vcs-ref": "7fb31fe42247120f04b5e2d94f1719411f1037e8", - "vcs-type": "git", - "vendor": "Red Hat, Inc.", - "version": "1" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516.want b/rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516.want deleted file mode 100644 index e71036221..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516.want +++ /dev/null @@ -1,20 +0,0 @@ -{ - "architecture": "x86_64", - "build-date": "2021-10-05T10:17:02.802845", - "com.redhat.build-host": "cpt-1007.osbs.prod.upshift.rdu2.redhat.com", - "com.redhat.component": "ubi7-container", - "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", - "description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", - "distribution-scope": "public", - "io.k8s.description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", - "io.k8s.display-name": "Red Hat Universal Base Image 7", - "io.openshift.tags": "base rhel7", - "name": "ubi7", - "release": "516", - "summary": "Provides the latest release of the Red Hat Universal Base Image 7.", - "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/images/7.9-516", - "vcs-ref": "a4e710a688a6374670ecdd56637c3f683d11cbe3", - "vcs-type": "git", - "vendor": "Red Hat, Inc.", - "version": "7.9" -} diff --git a/rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208.want b/rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208.want deleted file mode 100644 index ab1b3fc65..000000000 --- a/rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208.want +++ /dev/null @@ -1,22 +0,0 @@ -{ - "architecture": "x86_64", - "build-date": "2021-08-03T16:57:21.054109", - "com.redhat.build-host": "cpt-1002.osbs.prod.upshift.rdu2.redhat.com", - "distribution-scope": "public", - "io.k8s.description": "The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", - "release": "208", - "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8-minimal/images/8.4-208", - "vcs-ref": "7256039d3c371a38cf13906dcf5688c19700c73b", - "vcs-type": "git", - "vendor": "Red Hat, Inc.", - "com.redhat.component": "ubi8-minimal-container", - "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", - "description": "The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", - "io.k8s.display-name": "Red Hat Universal Base Image 8 Minimal", - "io.openshift.expose-services": "", - "io.openshift.tags": "minimal rhel8", - "maintainer": "Red Hat, Inc.", - "name": "ubi8-minimal", - "summary": "Provides the latest release of the minimal Red Hat Universal Base Image 8.", - "version": "8.4" -} diff --git a/rhel/dockerfile/testdata/InvalidLabel.txtar b/rhel/dockerfile/testdata/InvalidLabel.txtar new file mode 100644 index 000000000..e79b91dfb --- /dev/null +++ b/rhel/dockerfile/testdata/InvalidLabel.txtar @@ -0,0 +1,6 @@ +# Check that invalid comments cause an error. +! GetLabels +stderr '^invalid assignment syntax: `A=B \tC=D # Comments not allowed in this position`' +-- Dockerfile -- +LABEL A=B \ + C=D # Comments not allowed in this position diff --git a/rhel/dockerfile/testdata/Dockerfile-issue526 b/rhel/dockerfile/testdata/Issue526.txtar similarity index 52% rename from rhel/dockerfile/testdata/Dockerfile-issue526 rename to rhel/dockerfile/testdata/Issue526.txtar index 063f88e6a..350dde74e 100644 --- a/rhel/dockerfile/testdata/Dockerfile-issue526 +++ b/rhel/dockerfile/testdata/Issue526.txtar @@ -1,6 +1,11 @@ +-- Dockerfile -- FROM scratch ENV A="B C" \ D=E LABEL label="$A $D" +-- Want -- +{ + "label": "B C E" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-etcd-rhel7 b/rhel/dockerfile/testdata/etcd-rhel7.txtar similarity index 60% rename from rhel/dockerfile/testdata/Dockerfile-etcd-rhel7 rename to rhel/dockerfile/testdata/etcd-rhel7.txtar index 13727a546..7fb4ddbba 100644 --- a/rhel/dockerfile/testdata/Dockerfile-etcd-rhel7 +++ b/rhel/dockerfile/testdata/etcd-rhel7.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- FROM registry.stage.redhat.io/rhel7/rhel:7.9 ENV container=docker @@ -29,4 +30,19 @@ EXPOSE 4001 7001 2379 2380 ADD tmpfiles.template config.json.template service.template manifest.json /exports/ CMD ["/usr/bin/etcd-env.sh", "/usr/bin/etcd"] - +-- Want -- +{ + "com.redhat.component": "etcd-container", + "description": "etcd is a distributed reliable key-value store for the most critical data of a distributed system.", + "install": "/usr/bin/docker run --rm $OPT1 --privileged -v /:/host -e HOST=/host -e NAME=$NAME -e IMAGE=$IMAGE $IMAGE $OPT2 /usr/bin/install.sh $OPT3", + "io.k8s.description": "etcd is a distributed reliable key-value store for the most critical data of a distributed system.", + "io.k8s.display-name": "etcd", + "io.openshift.expose-services": "2379:tcp,2380:tcp", + "io.openshift.tags": "etcd", + "name": "rhel7/etcd", + "run": "/usr/bin/docker run -d $OPT1 -p 4001:4001 -p 7001:7001 -p 2379:2379 -p 2380:2380 --name $NAME $IMAGE $OPT2 $OPT3", + "summary": "A highly-available key value store for shared configuration", + "uninstall": "/usr/bin/docker run --rm $OPT1 --privileged -v /:/host -e HOST=/host -e NAME=$NAME -e IMAGE=$IMAGE $IMAGE $OPT2 /usr/bin/uninstall.sh $OPT3", + "usage": "etcd -help ", + "version": "3.2.32" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-nodejs10 b/rhel/dockerfile/testdata/nodejs10.txtar similarity index 64% rename from rhel/dockerfile/testdata/Dockerfile-nodejs10 rename to rhel/dockerfile/testdata/nodejs10.txtar index a7d349580..cf3415d57 100644 --- a/rhel/dockerfile/testdata/Dockerfile-nodejs10 +++ b/rhel/dockerfile/testdata/nodejs10.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- FROM ubi8/s2i-base:rhel8.1 # This image provides a Node.JS environment you can use to run your Node.JS @@ -71,3 +72,24 @@ USER 1001 # Set the default CMD to print the usage of the language image CMD $STI_SCRIPTS_PATH/usage +-- Want -- +{ + "com.redhat.component": "nodejs-10-container", + "com.redhat.deployments-dir": "/src", + "com.redhat.dev-mode": "DEV_MODE:false", + "com.redhat.dev-mode.port": "DEBUG_PORT:5858", + "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", + "description": "Node.js 10 available as container is a base platform for building and running various Node.js 10 applications and frameworks. Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.", + "help": "For more information visit https://github.com/sclorg/s2i-nodejs-container", + "io.k8s.description": "Node.js 10 available as container is a base platform for building and running various Node.js 10 applications and frameworks. Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.", + "io.k8s.display-name": "Node.js 10", + "io.openshift.expose-services": "8080:http", + "io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i", + "io.openshift.tags": "builder,nodejs,nodejs10", + "io.s2i.scripts-url": "image:///usr/libexec/s2i", + "maintainer": "SoftwareCollections.org ", + "name": "ubi8/10", + "summary": "Platform for building and running Node.js 10 applications", + "usage": "s2i build ubi8/10:latest ", + "version": "1" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4 b/rhel/dockerfile/testdata/quay-quay-rhel8-v3.5.6-4.txtar similarity index 87% rename from rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4 rename to rhel/dockerfile/testdata/quay-quay-rhel8-v3.5.6-4.txtar index 5a4dc7657..7c78e09ff 100644 --- a/rhel/dockerfile/testdata/Dockerfile-quay-quay-rhel8-v3.5.6-4 +++ b/rhel/dockerfile/testdata/quay-quay-rhel8-v3.5.6-4.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- FROM sha256:ad42391b9b4670e68a759d4cdb8780896071a1cb1ed519b474f901e597bf3b3d AS build-npm COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR @@ -153,3 +154,25 @@ CMD ["registry"] ADD quay-registry-container-v3.5.6-4.json /root/buildinfo/content_manifests/quay-registry-container-v3.5.6-4.json LABEL "release"="4" "com.redhat.license_terms"="https://www.redhat.com/agreements" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-08-17T21:16:14.144538" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="0e033c625b6a775f5be730ce5a938aa91cc46d29" "com.redhat.build-host"="example.com" "description"="Red Hat Quay" "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/quay/quay-rhel8/images/v3.5.6-4" +-- Want -- +{ + "architecture": "x86_64", + "build-date": "2021-08-17T21:16:14.144538", + "com.redhat.build-host": "example.com", + "com.redhat.component": "quay-registry-container", + "com.redhat.license_terms": "https://www.redhat.com/agreements", + "description": "Red Hat Quay", + "distribution-scope": "public", + "io.k8s.description": "Red Hat Quay", + "io.k8s.display-name": "Red Hat Quay", + "io.openshift.tags": "quay", + "maintainer": "support@redhat.com", + "name": "quay/quay-rhel8", + "release": "4", + "summary": "Red Hat Quay", + "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/quay/quay-rhel8/images/v3.5.6-4", + "vcs-ref": "0e033c625b6a775f5be730ce5a938aa91cc46d29", + "vcs-type": "git", + "vendor": "Red Hat, Inc.", + "version": "v3.5.6" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116 b/rhel/dockerfile/testdata/rhscl-redis-5-rhel7-5-53.1634738116.txtar similarity index 64% rename from rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116 rename to rhel/dockerfile/testdata/rhscl-redis-5-rhel7-5-53.1634738116.txtar index c14e2b496..fd4fcd867 100644 --- a/rhel/dockerfile/testdata/Dockerfile-rhscl-redis-5-rhel7-5-53.1634738116 +++ b/rhel/dockerfile/testdata/rhscl-redis-5-rhel7-5-53.1634738116.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- FROM sha256:80f381f67fab035e7df9e0714aca8a13b49af52f40482fadcfb893b50740272c # Redis image based on Software Collections packages @@ -87,3 +88,27 @@ CMD ["run-redis"] ADD help.1 /help.1 ADD rh-redis5-container-5-53.1634738116.json /root/buildinfo/content_manifests/rh-redis5-container-5-53.1634738116.json LABEL "release"="53.1634738116" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-10-20T13:56:03.899740" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="1ca08b535089c4828147120ead2699d9f237260a" "com.redhat.build-host"="cpt-1007.osbs.prod.upshift.rdu2.redhat.com" "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/redis-5-rhel7/images/5-53.1634738116" +-- Want -- +{ + "architecture": "x86_64", + "build-date": "2021-10-20T13:56:03.899740", + "com.redhat.build-host": "cpt-1007.osbs.prod.upshift.rdu2.redhat.com", + "com.redhat.component": "rh-redis5-container", + "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel", + "description": "Redis 5 available as container, is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log.", + "distribution-scope": "public", + "io.k8s.description": "Redis 5 available as container, is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log.", + "io.k8s.display-name": "Redis 5", + "io.openshift.expose-services": "6379:redis", + "io.openshift.tags": "database,redis,redis5,rh-redis5", + "maintainer": "SoftwareCollections.org ", + "name": "rhscl/redis-5-rhel7", + "release": "53.1634738116", + "summary": "Redis in-memory data structure store, used as database, cache and message broker", + "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/redis-5-rhel7/images/5-53.1634738116", + "usage": "podman run -d --name redis_database -p 6379:6379 rhscl/redis-5-rhel7", + "vcs-ref": "1ca08b535089c4828147120ead2699d9f237260a", + "vcs-type": "git", + "vendor": "Red Hat, Inc.", + "version": "5" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235 b/rhel/dockerfile/testdata/rhscl-s2i-core-rhel7-1-235.txtar similarity index 74% rename from rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235 rename to rhel/dockerfile/testdata/rhscl-s2i-core-rhel7-1-235.txtar index b4f4aa535..56071dc4a 100644 --- a/rhel/dockerfile/testdata/Dockerfile-rhscl-s2i-core-rhel7-1-235 +++ b/rhel/dockerfile/testdata/rhscl-s2i-core-rhel7-1-235.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- # This image is the base image for all s2i configurable container images. FROM sha256:6f683d6ef7a8199fdabf203f98cce97d628e40eefa42b7085f1f151d384a97fc @@ -83,3 +84,25 @@ RUN rpm-file-permissions && \ ADD help.1 /help.1 ADD s2i-core-container-1-235.json /root/buildinfo/content_manifests/s2i-core-container-1-235.json LABEL "release"="235" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-10-06T13:08:17.304497" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="7fb31fe42247120f04b5e2d94f1719411f1037e8" "com.redhat.build-host"="cpt-1005.osbs.prod.upshift.rdu2.redhat.com" "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/s2i-core-rhel7/images/1-235" +-- Want -- +{ + "architecture": "x86_64", + "build-date": "2021-10-06T13:08:17.304497", + "com.redhat.build-host": "cpt-1005.osbs.prod.upshift.rdu2.redhat.com", + "com.redhat.component": "s2i-core-container", + "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", + "description": "The s2i-core image provides any images layered on top of it with all the tools needed to use source-to-image functionality while keeping the image size as small as possible.", + "distribution-scope": "public", + "io.k8s.description": "The s2i-core image provides any images layered on top of it with all the tools needed to use source-to-image functionality while keeping the image size as small as possible.", + "io.k8s.display-name": "s2i core", + "io.openshift.s2i.scripts-url": "image:///usr/libexec/s2i", + "io.s2i.scripts-url": "image:///usr/libexec/s2i", + "name": "rhscl/s2i-core-rhel7", + "release": "235", + "summary": "Base image which allows using of source-to-image.", + "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/s2i-core-rhel7/images/1-235", + "vcs-ref": "7fb31fe42247120f04b5e2d94f1719411f1037e8", + "vcs-type": "git", + "vendor": "Red Hat, Inc.", + "version": "1" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516 b/rhel/dockerfile/testdata/ubi7-7.9.txtar similarity index 54% rename from rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516 rename to rhel/dockerfile/testdata/ubi7-7.9.txtar index 6364c375b..5de40851d 100644 --- a/rhel/dockerfile/testdata/Dockerfile-ubi7-7.9-516 +++ b/rhel/dockerfile/testdata/ubi7-7.9.txtar @@ -1,3 +1,4 @@ +-- Dockerfile -- FROM sha256:434a2388fbeb26e01bcd776e5c9de4ff73473f33013952ee34209e8b5259d927 MAINTAINER Red Hat, Inc. @@ -21,3 +22,24 @@ CMD ["/bin/bash"] ADD ubi7-container-7.9-516.json /root/buildinfo/content_manifests/ubi7-container-7.9-516.json LABEL "release"="516" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-10-05T10:17:02.802845" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="a4e710a688a6374670ecdd56637c3f683d11cbe3" "com.redhat.build-host"="cpt-1007.osbs.prod.upshift.rdu2.redhat.com" "io.k8s.description"="The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly." "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/images/7.9-516" +-- Want -- +{ + "architecture": "x86_64", + "build-date": "2021-10-05T10:17:02.802845", + "com.redhat.build-host": "cpt-1007.osbs.prod.upshift.rdu2.redhat.com", + "com.redhat.component": "ubi7-container", + "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", + "description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", + "distribution-scope": "public", + "io.k8s.description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", + "io.k8s.display-name": "Red Hat Universal Base Image 7", + "io.openshift.tags": "base rhel7", + "name": "ubi7", + "release": "516", + "summary": "Provides the latest release of the Red Hat Universal Base Image 7.", + "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/images/7.9-516", + "vcs-ref": "a4e710a688a6374670ecdd56637c3f683d11cbe3", + "vcs-type": "git", + "vendor": "Red Hat, Inc.", + "version": "7.9" +} diff --git a/rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208 b/rhel/dockerfile/testdata/ubi8-minimal-8.4-208.txtar similarity index 54% rename from rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208 rename to rhel/dockerfile/testdata/ubi8-minimal-8.4-208.txtar index 9380e6cef..243d1ca23 100644 --- a/rhel/dockerfile/testdata/Dockerfile-ubi8-minimal-8.4-208 +++ b/rhel/dockerfile/testdata/ubi8-minimal-8.4-208.txtar @@ -1,27 +1,51 @@ -FROM sha256:b3749cc58242c3fda50fb4541cd23144d42a85054d70bfe1e79eb719d212ac6f - -LABEL maintainer="Red Hat, Inc." - -LABEL com.redhat.component="ubi8-minimal-container" \ - name="ubi8-minimal" \ - version="8.4" - -#label for EULA -LABEL com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" - -#labels for container catalog -LABEL summary="Provides the latest release of the minimal Red Hat Universal Base Image 8." -LABEL description="The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly." -LABEL io.k8s.display-name="Red Hat Universal Base Image 8 Minimal" -LABEL io.openshift.expose-services="" -LABEL io.openshift.tags="minimal rhel8" - -ENV container oci -ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -CMD ["/bin/bash"] - -RUN rm -rf /var/log/* - -ADD ubi8-minimal-container-8.4-208.json /root/buildinfo/content_manifests/ubi8-minimal-container-8.4-208.json -LABEL "release"="208" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-08-03T16:57:21.054109" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="7256039d3c371a38cf13906dcf5688c19700c73b" "com.redhat.build-host"="cpt-1002.osbs.prod.upshift.rdu2.redhat.com" "io.k8s.description"="The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly." "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8-minimal/images/8.4-208" +-- Dockerfile -- +FROM sha256:b3749cc58242c3fda50fb4541cd23144d42a85054d70bfe1e79eb719d212ac6f + +LABEL maintainer="Red Hat, Inc." + +LABEL com.redhat.component="ubi8-minimal-container" \ + name="ubi8-minimal" \ + version="8.4" + +#label for EULA +LABEL com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + +#labels for container catalog +LABEL summary="Provides the latest release of the minimal Red Hat Universal Base Image 8." +LABEL description="The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly." +LABEL io.k8s.display-name="Red Hat Universal Base Image 8 Minimal" +LABEL io.openshift.expose-services="" +LABEL io.openshift.tags="minimal rhel8" + +ENV container oci +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +CMD ["/bin/bash"] + +RUN rm -rf /var/log/* + +ADD ubi8-minimal-container-8.4-208.json /root/buildinfo/content_manifests/ubi8-minimal-container-8.4-208.json +LABEL "release"="208" "distribution-scope"="public" "vendor"="Red Hat, Inc." "build-date"="2021-08-03T16:57:21.054109" "architecture"="x86_64" "vcs-type"="git" "vcs-ref"="7256039d3c371a38cf13906dcf5688c19700c73b" "com.redhat.build-host"="cpt-1002.osbs.prod.upshift.rdu2.redhat.com" "io.k8s.description"="The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly." "url"="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8-minimal/images/8.4-208" +-- Want -- +{ + "architecture": "x86_64", + "build-date": "2021-08-03T16:57:21.054109", + "com.redhat.build-host": "cpt-1002.osbs.prod.upshift.rdu2.redhat.com", + "com.redhat.component": "ubi8-minimal-container", + "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", + "description": "The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", + "distribution-scope": "public", + "io.k8s.description": "The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", + "io.k8s.display-name": "Red Hat Universal Base Image 8 Minimal", + "io.openshift.expose-services": "", + "io.openshift.tags": "minimal rhel8", + "maintainer": "Red Hat, Inc.", + "name": "ubi8-minimal", + "release": "208", + "summary": "Provides the latest release of the minimal Red Hat Universal Base Image 8.", + "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8-minimal/images/8.4-208", + "vcs-ref": "7256039d3c371a38cf13906dcf5688c19700c73b", + "vcs-type": "git", + "vendor": "Red Hat, Inc.", + "version": "8.4" +}