Skip to content

Commit

Permalink
zarf-game to doom game
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 7, 2024
1 parent 8c0a4c4 commit ba69765
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/dos-games/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ COPY --from=0 /binary /binary
WORKDIR /site
ENTRYPOINT ["/binary/darkhttpd", "/site", "--port", "8000"]

# docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/zarf-dev/zarf-game:0.0.1 .
# docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/zarf-dev/doom-game:0.0.1 .
2 changes: 1 addition & 1 deletion examples/dos-games/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: multi-game
image: ghcr.io/zarf-dev/zarf-game:0.0.1
image: ghcr.io/zarf-dev/doom-game:0.0.1
ports:
- name: http
containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion examples/dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ components:
- manifests/deployment.yaml
- manifests/service.yaml
images:
- ghcr.io/zarf-dev/zarf-game:0.0.1
- ghcr.io/zarf-dev/doom-game:0.0.1
actions:
onDeploy:
after:
Expand Down
12 changes: 6 additions & 6 deletions src/test/e2e/06_create_sbom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ func TestCreateSBOM(t *testing.T) {
require.NoError(t, err, stdOut, stdErr)
require.Contains(t, stdErr, "Creating SBOMs for 1 images and 0 components with files.")
// Test that the game package generates the SBOMs we expect (images only)
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_zarf-game_0.0.1.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "compare.html"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_zarf-game_0.0.1.json"))
require.FileExists(t, filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_doom-game_0.0.1.json"))

// Clean the SBOM path so it is force to be recreated
e2e.CleanFiles(sbomPath)

stdOut, stdErr, err = e2e.Zarf(t, "package", "inspect", pkgName, "--sbom-out", sbomPath)
require.NoError(t, err, stdOut, stdErr)
// Test that the game package generates the SBOMs we expect (images only)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_zarf-game_0.0.1.html"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.NoError(t, err)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "compare.html"))
require.NoError(t, err)
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_zarf-game_0.0.1.json"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "ghcr.io_zarf-dev_doom-game_0.0.1.json"))
require.NoError(t, err)

stdOut, _, err = e2e.Zarf(t, "package", "inspect", pkgName, "--list-images")
require.NoError(t, err)
require.Equal(t, "- ghcr.io/zarf-dev/zarf-game:0.0.1\n", stdOut)
require.Equal(t, "- ghcr.io/zarf-dev/doom-game:0.0.1\n", stdOut)

// Pull the current zarf binary version to find the corresponding init package
version, stdErr, err := e2e.Zarf(t, "version")
Expand All @@ -54,7 +54,7 @@ func TestCreateSBOM(t *testing.T) {
stdOut, stdErr, err = e2e.Zarf(t, "package", "inspect", initName, "--sbom-out", sbomPath)
require.NoError(t, err, stdOut, stdErr)
// Test that we preserve the filepath
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_zarf-game_0.0.1.html"))
_, err = os.ReadFile(filepath.Join(sbomPath, "dos-games", "sbom-viewer-ghcr.io_zarf-dev_doom-game_0.0.1.html"))
require.NoError(t, err)
// Test that the init package generates the SBOMs we expect (images + component files)
_, err = os.ReadFile(filepath.Join(sbomPath, "init", "sbom-viewer-docker.io_gitea_gitea_1.21.5-rootless.html"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: multi-game
image: "ghcr.io/zarf-dev/zarf-game:0.0.1"
image: "ghcr.io/zarf-dev/doom-game:0.0.1"
ports:
- name: http
containerPort: 8000
Expand Down
2 changes: 1 addition & 1 deletion src/test/packages/25-manifest-adoption/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: multi-game
image: "ghcr.io/zarf-dev/zarf-game:0.0.1"
image: "ghcr.io/zarf-dev/doom-game:0.0.1"
ports:
- name: http
containerPort: 8000
Expand Down
4 changes: 2 additions & 2 deletions src/test/packages/26-image-dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ components:
- name: baseline
required: true
images:
- ghcr.io/zarf-dev/zarf-game:0.0.1
- ghcr.io/zarf-dev/zarf-game:0.0.1@sha256:0a44b759e219d9d6f3c7cbbf40c57ede71a1f9bf54da65767c4137be74727662
- ghcr.io/zarf-dev/doom-game:0.0.1
- ghcr.io/zarf-dev/doom-game:0.0.1@sha256:0a44b759e219d9d6f3c7cbbf40c57ede71a1f9bf54da65767c4137be74727662
- ghcr.io/zarf-dev/zarf-game@sha256:0a44b759e219d9d6f3c7cbbf40c57ede71a1f9bf54da65767c4137be74727662

0 comments on commit ba69765

Please sign in to comment.