-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce test disk usage and normalize git tests (#1958)
## Description Reduce the disk usage in tests by clearing the cache path for packages with images and simplifying the git data test ## Related Issue Fixes #N/A ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [X] Other (security config, docs update, etc) ## Checklist before merging - [X] Test, docs, adr added or updated as needed - [X] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed
- Loading branch information
Showing
4 changed files
with
44 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,67 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: git-data-check-secrets | ||
name: git-data-test | ||
version: 1.0.0 | ||
description: Demo Zarf loading resources into a gitops service - while checking that the component secret gets updated with each component | ||
description: A Git package with additional test cases for different scenarios | ||
|
||
components: | ||
- name: flux-demo | ||
required: true | ||
images: | ||
- ghcr.io/stefanprodan/podinfo:6.0.0 | ||
repos: | ||
# Do a full Git Repo Mirror of a flux repo | ||
- https://github.com/stefanprodan/podinfo.git | ||
|
||
- name: full-repo | ||
required: true | ||
repos: | ||
# Do a full Git Repo Mirror | ||
- https://github.com/kelseyhightower/nocode.git | ||
# Perform a full repo mirror of a simple repository with a single branch - this causes an "already up to date" error in go-git | ||
- https://github.com/defenseunicorns/zarf-public-test.git | ||
# The following performs a full Git Repo Mirror forcing a fallback to host `git` | ||
- https://racer159.visualstudio.com/zarf-public-test/_git/zarf-public-test | ||
# Perform a full repo mirror of a simple repository with a single branch - (this causes an "already up to date" error in go-git) | ||
- https://github.com/defenseunicorns/golang-tekton-hello-world.git | ||
actions: | ||
onDeploy: | ||
before: | ||
# Check to verify the package secret has been saved for the already deployed component | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-check-secrets -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 1 | ||
description: Check that the package secret has been updated with the deployed component | ||
maxRetries: 3 | ||
|
||
- name: specific-tag | ||
required: true | ||
repos: | ||
# Do a tag-provided Git Repo mirror | ||
- https://github.com/defenseunicorns/[email protected] | ||
# Use the git refspec pattern to get a tag | ||
- https://github.com/defenseunicorns/zarf.git@refs/tags/v0.16.0 | ||
# The following performs a tag Git Repo Mirror with `go-git` (internal to Zarf) | ||
- https://github.com/defenseunicorns/[email protected] | ||
# The following performs a refspec tag Git Repo Mirror with `go-git` | ||
- https://github.com/defenseunicorns/zarf-public-test.git@refs/tags/v0.0.1 | ||
# The following performs a tag Git Repo Mirror forcing a fallback to host `git` | ||
- https://racer159.visualstudio.com/zarf-public-test/_git/[email protected] | ||
actions: | ||
onDeploy: | ||
before: | ||
# Check to verify the package secret has been saved for the already deployed component | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-check-secrets -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 2 | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-test -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 1 | ||
description: Check that the package secret has been updated with the deployed component | ||
maxRetries: 3 | ||
|
||
- name: specific-branch | ||
required: true | ||
repos: | ||
# Do a branch-provided Git Repo mirror | ||
- https://github.com/DoD-Platform-One/big-bang.git@refs/heads/release-1.54.x | ||
# The following performs a branch Git Repo Mirror with `go-git` (internal to Zarf) | ||
- https://github.com/defenseunicorns/zarf-public-test.git@refs/heads/dragons | ||
# The following performs a branch Git Repo Mirror forcing a fallback to host `git` | ||
- https://racer159.visualstudio.com/zarf-public-test/_git/zarf-public-test@refs/heads/dragons | ||
actions: | ||
onDeploy: | ||
before: | ||
# Check to verify the package secret has been saved for the already deployed component | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-check-secrets -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 3 | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-test -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 2 | ||
description: Check that the package secret has been updated with the deployed component | ||
maxRetries: 3 | ||
|
||
- name: specific-hash | ||
required: true | ||
repos: | ||
# Do a commit hash Git Repo mirror | ||
- https://github.com/defenseunicorns/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e | ||
# Clone an azure repo (w/SHA) that breaks in go-git and has to fall back to the host git | ||
- https://[email protected].com/me0515/zarf-public-test/_git/zarf-public-test@524980951ff16e19dc25232e9aea8fd693989ba6 | ||
# The following performs a SHA Git Repo Mirror with `go-git` (internal to Zarf) | ||
- https://github.com/defenseunicorns/zarf-public-test.git@01a23218923f24194133b5eb11268cf8d73ff1bb | ||
# The following performs a SHA Git Repo Mirror forcing a fallback to host `git` | ||
- https://racer159.visualstudio.com/zarf-public-test/_git/zarf-public-test@01a23218923f24194133b5eb11268cf8d73ff1bb | ||
actions: | ||
onDeploy: | ||
before: | ||
# Check to verify the package secret has been saved for the already deployed component | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-check-secrets -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 4 | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-test -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 3 | ||
description: Check that the package secret has been updated with the deployed component | ||
maxRetries: 3 | ||
onSuccess: | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-check-secrets -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 5 | ||
- cmd: test $(./zarf tools kubectl get secret -n zarf zarf-package-git-data-test -o jsonpath='{.data.*}' | base64 --decode | jq -r .deployedComponents | jq '. | length') -eq 4 | ||
description: Check that the package secret has been updated with the deployed component | ||
maxRetries: 3 |