-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
570 additions
and
27 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
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
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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: UDS - Smoke Test | ||
|
||
permissions: read-all | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * *' # 12AM EST/9PM PST | ||
|
||
jobs: | ||
pepr-build: | ||
name: pepr build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: clone pepr | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
repository: defenseunicorns/pepr | ||
path: pepr | ||
|
||
- name: "set env: PEPR" | ||
run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV" | ||
|
||
- name: setup node | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 20 | ||
cache: "npm" | ||
cache-dependency-path: pepr | ||
|
||
- name: install pepr deps | ||
run: | | ||
cd "$PEPR" | ||
npm ci | ||
- name: build pepr image | ||
run: | | ||
cd "$PEPR" | ||
npm run build:image | ||
- name: tar pepr image | ||
run: | | ||
PEPR_TAR="${GITHUB_WORKSPACE}/pepr-img.tar" | ||
echo "PEPR_TAR=${PEPR_TAR}" >> "$GITHUB_ENV" | ||
docker image save --output "$PEPR_TAR" pepr:dev | ||
- name: upload image tar artifact | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
with: | ||
name: pepr-img.tar | ||
path: pepr-img.tar | ||
retention-days: 1 | ||
|
||
uds-run: | ||
name: uds run | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pepr-build | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: "install k3d" | ||
run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash" | ||
shell: bash | ||
|
||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
repository: defenseunicorns/uds-core | ||
path: uds-core | ||
|
||
- name: "set env: UDS_CORE" | ||
run: echo "UDS_CORE=${GITHUB_WORKSPACE}/uds-core" >> "$GITHUB_ENV" | ||
|
||
- name: setup node | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 20 | ||
cache: "npm" | ||
cache-dependency-path: uds-core | ||
|
||
- name: install uds cli | ||
run: | | ||
LATEST_URL="https://api.github.com/repos/defenseunicorns/uds-cli/releases/latest" | ||
REMOTE_URL=$( | ||
curl --silent "$LATEST_URL" \ | ||
| grep 'browser_download_url.*_Linux_amd64"' \ | ||
| cut -d : -f 2,3 \ | ||
| tr -d \" \ | ||
| tr -d " " | ||
) | ||
BINS="$HOME/.local/bin" | ||
mkdir -p "$BINS" | ||
UDS_CLI="$BINS/uds" | ||
curl --location --output "$UDS_CLI" "$REMOTE_URL" | ||
chmod +x "$UDS_CLI" | ||
uds version | ||
- name: dowload image tar artifact | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: pepr-img.tar | ||
path: ${{ github.workspace }} | ||
|
||
- name: "set env: PEPR_IMG" | ||
run: echo "PEPR_IMG=${GITHUB_WORKSPACE}/pepr-img.tar" >> "$GITHUB_ENV" | ||
|
||
- name: import docker image from pepr tar | ||
run: | | ||
docker image load --input "$PEPR_IMG" | ||
- name: uds run | ||
run: | | ||
cd "$UDS_CORE" | ||
PEPR_CUSTOM_IMAGE="pepr:dev" uds run slim-dev |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Finalize | ||
|
||
A specialized combination of Pepr's [Mutate](./010_mutate.md) & [Watch](./040_watch.md) functionalities that allow a module author to run logic while Kubernetes is [Finalizing](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/) a resource (i.e. cleaning up related resources _after_ a deleteion request has been accepted). | ||
|
||
This method will: | ||
|
||
1. Inject a finalizer into the `metadata.finalizers` field of the requested resource during the mutation phase of the admission. | ||
|
||
1. Watch appropriate resource lifecycle events & invoke the given callback. | ||
|
||
1. Remove the injected finalizer from the `metadata.finalizers` field of the requested resource. |
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
Oops, something went wrong.