From 447d9846cc4ad6e76c3895d19836e6668c65cec5 Mon Sep 17 00:00:00 2001 From: Philip Laine Date: Wed, 7 Aug 2024 16:19:42 +0200 Subject: [PATCH 1/4] test: add tests for FindImages (#2850) Signed-off-by: Philip Laine --- src/pkg/packager/creator/creator_test.go | 19 ++--------- src/pkg/packager/prepare.go | 15 ++++----- src/pkg/packager/prepare_test.go | 42 ++++++++++++++++++++++++ src/test/testutil/schema.go | 33 +++++++++++++++++++ src/test/testutil/testutil.go | 2 ++ 5 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 src/pkg/packager/prepare_test.go create mode 100644 src/test/testutil/schema.go diff --git a/src/pkg/packager/creator/creator_test.go b/src/pkg/packager/creator/creator_test.go index 9312fe0a2c..95803cc0f4 100644 --- a/src/pkg/packager/creator/creator_test.go +++ b/src/pkg/packager/creator/creator_test.go @@ -6,7 +6,6 @@ package creator import ( "context" - "io/fs" "os" "path/filepath" "testing" @@ -14,22 +13,10 @@ import ( "github.com/stretchr/testify/require" "github.com/zarf-dev/zarf/src/pkg/layout" "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/test/testutil" "github.com/zarf-dev/zarf/src/types" ) -type mockSchemaLoader struct { - b []byte -} - -func (m *mockSchemaLoader) ReadFile(_ string) ([]byte, error) { - return m.b, nil -} - -// Satisfy fs.ReadFileFS interface -func (m *mockSchemaLoader) Open(_ string) (fs.File, error) { - return nil, nil -} - func TestLoadPackageDefinition(t *testing.T) { // TODO once creator is refactored to not expect to be in the same directory as the zarf.yaml file // this test can be re-parallelized @@ -64,9 +51,7 @@ func TestLoadPackageDefinition(t *testing.T) { creator: NewSkeletonCreator(types.ZarfCreateOptions{}, types.ZarfPublishOptions{}), }, } - b, err := os.ReadFile("../../../../zarf.schema.json") - require.NoError(t, err) - lint.ZarfSchema = &mockSchemaLoader{b: b} + lint.ZarfSchema = testutil.LoadSchema(t, "../../../../zarf.schema.json") for _, tt := range tests { tt := tt diff --git a/src/pkg/packager/prepare.go b/src/pkg/packager/prepare.go index d007e862bd..214258634a 100644 --- a/src/pkg/packager/prepare.go +++ b/src/pkg/packager/prepare.go @@ -13,10 +13,15 @@ import ( "sort" "strings" - "github.com/goccy/go-yaml" - "github.com/defenseunicorns/pkg/helpers/v2" + "github.com/goccy/go-yaml" "github.com/google/go-containerregistry/pkg/crane" + v1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/internal/packager/helm" @@ -27,12 +32,6 @@ import ( "github.com/zarf-dev/zarf/src/pkg/packager/creator" "github.com/zarf-dev/zarf/src/pkg/utils" "github.com/zarf-dev/zarf/src/types" - v1 "k8s.io/api/apps/v1" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" ) // imageMap is a map of image/boolean pairs. diff --git a/src/pkg/packager/prepare_test.go b/src/pkg/packager/prepare_test.go new file mode 100644 index 0000000000..1f704fdfdc --- /dev/null +++ b/src/pkg/packager/prepare_test.go @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package packager + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/zarf-dev/zarf/src/pkg/lint" + "github.com/zarf-dev/zarf/src/test/testutil" + "github.com/zarf-dev/zarf/src/types" +) + +func TestFindImages(t *testing.T) { + t.Parallel() + + ctx := testutil.TestContext(t) + + lint.ZarfSchema = testutil.LoadSchema(t, "../../../zarf.schema.json") + + cfg := &types.PackagerConfig{ + CreateOpts: types.ZarfCreateOptions{ + BaseDir: "../../../examples/dos-games/", + }, + } + p, err := New(cfg) + require.NoError(t, err) + images, err := p.FindImages(ctx) + require.NoError(t, err) + expectedImages := map[string][]string{ + "baseline": { + "defenseunicorns/zarf-game:multi-tile-dark", + "index.docker.io/defenseunicorns/zarf-game:sha256-0b694ca1c33afae97b7471488e07968599f1d2470c629f76af67145ca64428af.sig", + }, + } + require.Equal(t, len(expectedImages), len(images)) + for k, v := range expectedImages { + require.ElementsMatch(t, v, images[k]) + } +} diff --git a/src/test/testutil/schema.go b/src/test/testutil/schema.go new file mode 100644 index 0000000000..967e6e64ba --- /dev/null +++ b/src/test/testutil/schema.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package testutil + +import ( + "io/fs" + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +type schemaFS struct { + b []byte +} + +func (m *schemaFS) ReadFile(_ string) ([]byte, error) { + return m.b, nil +} + +func (m *schemaFS) Open(_ string) (fs.File, error) { + return nil, nil +} + +// LoadSchema returns the schema file as a FS. +func LoadSchema(t *testing.T, path string) fs.ReadFileFS { + t.Helper() + + b, err := os.ReadFile(path) + require.NoError(t, err) + return &schemaFS{b: b} +} diff --git a/src/test/testutil/testutil.go b/src/test/testutil/testutil.go index 862bca937d..672f1ae194 100644 --- a/src/test/testutil/testutil.go +++ b/src/test/testutil/testutil.go @@ -12,6 +12,8 @@ import ( // TestContext takes a testing.T and returns a context that is // attached to the test by t.Cleanup() func TestContext(t *testing.T) context.Context { + t.Helper() + ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) return ctx From 35952d8807961af2a595e72a56657c1119a6096f Mon Sep 17 00:00:00 2001 From: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:34:38 -0400 Subject: [PATCH 2/4] test: unit test index sha (#2844) Signed-off-by: Austin Abro --- src/internal/packager/images/pull.go | 39 ++++++----- src/internal/packager/images/pull_test.go | 69 +++++++++++++++++++ .../packager/images/testdata/agent-index.json | 50 ++++++++++++++ .../images/testdata/agent-manifest.json | 21 ++++++ .../packager/images/testdata/game-index.json | 34 +++++++++ src/test/e2e/14_create_sha_index_test.go | 40 ----------- .../14-index-sha/image-index/zarf.yaml | 9 --- .../14-index-sha/manifest-list/zarf.yaml | 9 --- 8 files changed, 196 insertions(+), 75 deletions(-) create mode 100644 src/internal/packager/images/testdata/agent-index.json create mode 100644 src/internal/packager/images/testdata/agent-manifest.json create mode 100644 src/internal/packager/images/testdata/game-index.json delete mode 100644 src/test/e2e/14_create_sha_index_test.go delete mode 100644 src/test/packages/14-index-sha/image-index/zarf.yaml delete mode 100644 src/test/packages/14-index-sha/manifest-list/zarf.yaml diff --git a/src/internal/packager/images/pull.go b/src/internal/packager/images/pull.go index 7a313c5db0..67907feb9d 100644 --- a/src/internal/packager/images/pull.go +++ b/src/internal/packager/images/pull.go @@ -40,6 +40,26 @@ import ( "golang.org/x/sync/errgroup" ) +func checkForIndex(refInfo transform.Image, desc *remote.Descriptor) error { + if refInfo.Digest != "" && desc != nil && types.MediaType(desc.MediaType).IsIndex() { + var idx v1.IndexManifest + if err := json.Unmarshal(desc.Manifest, &idx); err != nil { + return fmt.Errorf("unable to unmarshal index.json: %w", err) + } + lines := []string{"The following images are available in the index:"} + name := refInfo.Name + if refInfo.Tag != "" { + name += ":" + refInfo.Tag + } + for _, desc := range idx.Manifests { + lines = append(lines, fmt.Sprintf("image - %s@%s with platform %s", name, desc.Digest.String(), desc.Platform.String())) + } + imageOptions := strings.Join(lines, "\n") + return fmt.Errorf("%s resolved to an OCI image index which is not supported by Zarf, select a specific platform to use: %s", refInfo.Reference, imageOptions) + } + return nil +} + // Pull pulls all of the images from the given config. func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, error) { var longer string @@ -146,23 +166,8 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er } } - if refInfo.Digest != "" && desc != nil && types.MediaType(desc.MediaType).IsIndex() { - message.Warn("Zarf does not currently support direct consumption of OCI image indexes or Docker manifest lists") - - var idx v1.IndexManifest - if err := json.Unmarshal(desc.Manifest, &idx); err != nil { - return fmt.Errorf("unable to unmarshal index manifest: %w", err) - } - lines := []string{"The following images are available in the index:"} - name := refInfo.Name - if refInfo.Tag != "" { - name += ":" + refInfo.Tag - } - for _, desc := range idx.Manifests { - lines = append(lines, fmt.Sprintf("\n(%s) %s@%s", desc.Platform, name, desc.Digest)) - } - message.Warn(strings.Join(lines, "\n")) - return fmt.Errorf("%s resolved to an index, please select a specific platform to use", refInfo.Reference) + if err := checkForIndex(refInfo, desc); err != nil { + return err } cacheImg, err := utils.OnlyHasImageLayers(img) diff --git a/src/internal/packager/images/pull_test.go b/src/internal/packager/images/pull_test.go index eef8bbc9e8..ad38bb3aac 100644 --- a/src/internal/packager/images/pull_test.go +++ b/src/internal/packager/images/pull_test.go @@ -6,14 +6,83 @@ package images import ( "context" + "encoding/json" + "fmt" "os" "path/filepath" "testing" + v1 "github.com/google/go-containerregistry/pkg/v1" + "github.com/google/go-containerregistry/pkg/v1/remote" "github.com/stretchr/testify/require" "github.com/zarf-dev/zarf/src/pkg/transform" ) +func TestCheckForIndex(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + ref string + file string + expectedErr string + }{ + { + name: "index sha", + ref: "ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:05a82656df5466ce17c3e364c16792ae21ce68438bfe06eeab309d0520c16b48", + file: "agent-index.json", + expectedErr: "%s resolved to an OCI image index which is not supported by Zarf, select a specific platform to use", + }, + { + name: "docker manifest list", + ref: "defenseunicorns/zarf-game@sha256:0b694ca1c33afae97b7471488e07968599f1d2470c629f76af67145ca64428af", + file: "game-index.json", + expectedErr: "%s resolved to an OCI image index which is not supported by Zarf, select a specific platform to use", + }, + { + name: "image manifest", + ref: "ghcr.io/zarf-dev/zarf/agent:v0.32.6", + file: "agent-manifest.json", + expectedErr: "", + }, + { + name: "image manifest sha'd", + ref: "ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", + file: "agent-manifest.json", + expectedErr: "", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + refInfo, err := transform.ParseImageRef(tc.ref) + require.NoError(t, err) + file := filepath.Join("testdata", tc.file) + manifest, err := os.ReadFile(file) + require.NoError(t, err) + var idx v1.IndexManifest + err = json.Unmarshal(manifest, &idx) + require.NoError(t, err) + desc := &remote.Descriptor{ + Descriptor: v1.Descriptor{ + MediaType: idx.MediaType, + }, + Manifest: manifest, + } + err = checkForIndex(refInfo, desc) + if tc.expectedErr != "" { + require.ErrorContains(t, err, fmt.Sprintf(tc.expectedErr, refInfo.Reference)) + // Ensure the error message contains the digest of the manifests the user can use + for _, manifest := range idx.Manifests { + require.ErrorContains(t, err, manifest.Digest.String()) + } + return + } + require.NoError(t, err) + }) + } +} + func TestPull(t *testing.T) { t.Run("pulling a cosign image is successful and doesn't add anything to the cache", func(t *testing.T) { ref, err := transform.ParseImageRef("ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8.sig") diff --git a/src/internal/packager/images/testdata/agent-index.json b/src/internal/packager/images/testdata/agent-index.json new file mode 100644 index 0000000000..2288b7f242 --- /dev/null +++ b/src/internal/packager/images/testdata/agent-index.json @@ -0,0 +1,50 @@ +{ + "schemaVersion": 2, + "mediaType": "application/vnd.oci.image.index.v1+json", + "manifests": [ + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", + "size": 673, + "platform": { + "architecture": "arm64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:454bf871b5d826b6a31ab14c983583ae9d9e30c2036606b500368c5b552d8fdf", + "size": 673, + "platform": { + "architecture": "amd64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:449cd2cd763614f07219f38f8514b56c7831d583f7c6f767491d3ad31572189c", + "size": 566, + "annotations": { + "vnd.docker.reference.digest": "sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + }, + { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:2b51d89bf901b4e65dd85d8c6f135278fc7f86bb48608f0681a83291deadd645", + "size": 566, + "annotations": { + "vnd.docker.reference.digest": "sha256:454bf871b5d826b6a31ab14c983583ae9d9e30c2036606b500368c5b552d8fdf", + "vnd.docker.reference.type": "attestation-manifest" + }, + "platform": { + "architecture": "unknown", + "os": "unknown" + } + } + ] +} diff --git a/src/internal/packager/images/testdata/agent-manifest.json b/src/internal/packager/images/testdata/agent-manifest.json new file mode 100644 index 0000000000..5ef1467f7e --- /dev/null +++ b/src/internal/packager/images/testdata/agent-manifest.json @@ -0,0 +1,21 @@ +{ + "schemaVersion": 2, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": { + "mediaType": "application/vnd.oci.image.config.v1+json", + "digest": "sha256:cd4790c66d0f72eb0e0c12d75c1025478294af876ff0042d1c3501db57b0244b", + "size": 1284 + }, + "layers": [ + { + "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip", + "digest": "sha256:32f8946351207153325c9d5eb56c61bbd96f9cd8deaa6dcecc4a3d4867609bec", + "size": 327582 + }, + { + "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip", + "digest": "sha256:72dbbe2df2af4ee1b7a0c7ee66782999e8f6f846ffed250aec3738791d941ba7", + "size": 38937433 + } + ] +} diff --git a/src/internal/packager/images/testdata/game-index.json b/src/internal/packager/images/testdata/game-index.json new file mode 100644 index 0000000000..b8eadb836d --- /dev/null +++ b/src/internal/packager/images/testdata/game-index.json @@ -0,0 +1,34 @@ +{ + "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "schemaVersion": 2, + "manifests": [ + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "digest": "sha256:f78e442f0f3eb3e9459b5ae6b1a8fda62f8dfe818112e7d130a4e8ae72b3cbff", + "size": 739, + "platform": { + "architecture": "arm", + "os": "linux", + "variant": "v7" + } + }, + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "digest": "sha256:e4d27fe4b7bf6d5cb7ef02ed0d33ec0846796c09d6ed4bd94c8b946119a01b09", + "size": 739, + "platform": { + "architecture": "arm64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "digest": "sha256:e81b1467b812019f8e8e81450728b084471806dc7e959b7beb9f39933c337e7d", + "size": 739, + "platform": { + "architecture": "amd64", + "os": "linux" + } + } + ] +} diff --git a/src/test/e2e/14_create_sha_index_test.go b/src/test/e2e/14_create_sha_index_test.go deleted file mode 100644 index 40b198738b..0000000000 --- a/src/test/e2e/14_create_sha_index_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -// Package test provides e2e tests for Zarf. -package test - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestCreateIndexShaErrors(t *testing.T) { - t.Log("E2E: CreateIndexShaErrors") - - testCases := []struct { - name string - packagePath string - expectedImageInStderr string - }{ - { - name: "Image Index", - packagePath: "src/test/packages/14-index-sha/image-index", - expectedImageInStderr: "ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:b3fabdc7d4ecd0f396016ef78da19002c39e3ace352ea0ae4baa2ce9d5958376", - }, - { - name: "Manifest List", - packagePath: "src/test/packages/14-index-sha/manifest-list", - expectedImageInStderr: "docker.io/defenseunicorns/zarf-game@sha256:f78e442f0f3eb3e9459b5ae6b1a8fda62f8dfe818112e7d130a4e8ae72b3cbff", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, stderr, err := e2e.Zarf(t, "package", "create", tc.packagePath, "--confirm") - require.Error(t, err) - require.Contains(t, stderr, tc.expectedImageInStderr) - }) - } -} diff --git a/src/test/packages/14-index-sha/image-index/zarf.yaml b/src/test/packages/14-index-sha/image-index/zarf.yaml deleted file mode 100644 index 76d3e6ab4f..0000000000 --- a/src/test/packages/14-index-sha/image-index/zarf.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: ZarfPackageConfig -metadata: - name: image-index - -components: - - name: baseline - required: true - images: - - ghcr.io/zarf-dev/zarf/agent:v0.32.6@sha256:05a82656df5466ce17c3e364c16792ae21ce68438bfe06eeab309d0520c16b48 diff --git a/src/test/packages/14-index-sha/manifest-list/zarf.yaml b/src/test/packages/14-index-sha/manifest-list/zarf.yaml deleted file mode 100644 index 9d7ad76b20..0000000000 --- a/src/test/packages/14-index-sha/manifest-list/zarf.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: ZarfPackageConfig -metadata: - name: manifest-list - -components: - - name: baseline - required: true - images: - - defenseunicorns/zarf-game@sha256:0b694ca1c33afae97b7471488e07968599f1d2470c629f76af67145ca64428af From 2485de9472b87db6f7da34269e34cd07c1d787fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:22:07 +0000 Subject: [PATCH 3/4] chore(deps): bump github.com/spf13/viper from 1.18.2 to 1.19.0 (#2828) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4e4ef20ac3..eda6a176ee 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.7 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 github.com/xeipuuv/gojsonschema v1.2.0 github.com/zarf-dev/zarf/src/api v0.0.0-00010101000000-000000000000 diff --git a/go.sum b/go.sum index 4d6331b57f..a8b3b34e62 100644 --- a/go.sum +++ b/go.sum @@ -1597,8 +1597,8 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/spiffe/go-spiffe/v2 v2.1.7 h1:VUkM1yIyg/x8X7u1uXqSRVRCdMdfRIEdFBzpqoeASGk= github.com/spiffe/go-spiffe/v2 v2.1.7/go.mod h1:QJDGdhXllxjxvd5B+2XnhhXB/+rC8gr+lNrtOryiWeE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From 02f29325acfbb07081fbf8ee1476582e3ff5e7bc Mon Sep 17 00:00:00 2001 From: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:22:50 -0400 Subject: [PATCH 4/4] chore: update dos games (#2845) Signed-off-by: Austin Abro --- examples/dos-games/image/Dockerfile | 14 ++-------- examples/dos-games/image/index.html | 22 +++------------- examples/dos-games/manifests/deployment.yaml | 2 +- examples/dos-games/zarf.yaml | 2 +- src/pkg/packager/prepare_test.go | 4 +-- src/test/e2e/06_create_sbom_test.go | 12 ++++----- .../packages/12-lint/linted-import/zarf.yaml | 8 +++--- src/test/packages/12-lint/zarf.yaml | 26 +++++++++---------- .../manifests/evil-deployment.yaml | 2 +- .../25-manifest-adoption/deployment.yaml | 2 +- .../packages/26-image-dos-games/zarf.yaml | 6 ++--- 11 files changed, 37 insertions(+), 63 deletions(-) diff --git a/examples/dos-games/image/Dockerfile b/examples/dos-games/image/Dockerfile index f992f00743..80c94dc5e8 100644 --- a/examples/dos-games/image/Dockerfile +++ b/examples/dos-games/image/Dockerfile @@ -10,19 +10,9 @@ RUN wget https://js-dos.com/6.22/current/js-dos.js && \ wget https://js-dos.com/6.22/current/wdosbox.js && \ wget https://js-dos.com/6.22/current/wdosbox.wasm.js -RUN wget -O aladdin.zip "https://web.archive.org/web/20190303222445if_/https://www.dosgames.com/files/DOSBOX_ALADDIN.ZIP" RUN wget -O doom.zip "https://archive.org/download/DoomsharewareEpisode/doom.ZIP" -RUN wget -O mario-brothers.zip "https://image.dosgamesarchive.com/games/mario-bro.zip" -RUN wget -O prince-of-persia.zip "https://web.archive.org/web/20181030180256if_/http://image.dosgamesarchive.com/games/pop1.zip" -RUN wget -O quake.zip "https://web.archive.org/web/20190303223506if_/https://www.dosgames.com/files/DOSBOX_QUAKE.ZIP" -RUN wget -O warcraft-ii.zip "https://web.archive.org/web/20190303222732if_/https://www.dosgames.com/files/DOSBOX_WAR2.ZIP" -RUN wget -O aladdin.png "https://image.dosgamesarchive.com/screenshots/aladdem-4.png" && \ - wget -O doom.png "https://image.dosgamesarchive.com/screenshots/doom01.png" && \ - wget -O mario-brothers.png "https://image.dosgamesarchive.com/screenshots/marionl-6.png" && \ - wget -O prince-of-persia.png "https://image.dosgamesarchive.com/screenshots/prince102.png" && \ - wget -O quake.png "https://image.dosgamesarchive.com/screenshots/quake13.png" && \ - wget -O warcraft-ii.png "https://image.dosgamesarchive.com/screenshots/war2demo3.png" +RUN wget -O doom.png "https://image.dosgamesarchive.com/screenshots/doom01.png" COPY index.html . @@ -34,4 +24,4 @@ COPY --from=0 /binary /binary WORKDIR /site ENTRYPOINT ["/binary/darkhttpd", "/site", "--port", "8000"] -# docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag defenseunicorns/zarf-game:multi-tile . +# docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/zarf-dev/doom-game:0.0.1 . diff --git a/examples/dos-games/image/index.html b/examples/dos-games/image/index.html index f8d89574ca..09cdd0ff47 100644 --- a/examples/dos-games/image/index.html +++ b/examples/dos-games/image/index.html @@ -47,9 +47,10 @@ } .column img { - margin-top: 8px; + margin-top: 16px; vertical-align: middle; width: 100%; + height: auto; } /* Responsive layout - makes a two column-layout instead of four columns */ @@ -70,7 +71,6 @@ } } - @@ -78,14 +78,7 @@