Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/auto-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
contents: write # Allows writing content to the repository.
packages: read # Allows reading the content of the repository's packages.
pull-requests: write # Allows creating or updating pull requests.

# Abort prior jobs in the same workflow / PR
concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
type: [install, upgrade]
flavor: [upstream, unicorn, registry1]
flavor: [upstream]
uses: defenseunicorns/uds-common/.github/workflows/callable-test.yaml@10a8fbeef50416b8c4b0b86f17f6e31f84598294 # v1.24.1
with:
timeout: 30
Expand Down
5 changes: 0 additions & 5 deletions bundle/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ metadata:
version: dev

packages:
# #TEMPLATE_APPLICATION_NAME# has a dependency on some-application
# - name: some-application
# repository: ghcr.io/defenseunicorns/packages/uds/some-application
# ref: 0.1.3-upstream

- name: #TEMPLATE_APPLICATION_NAME#
path: ../
ref: dev
7 changes: 0 additions & 7 deletions bundle/uds-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# variables:
# some-application:
# EXAMPLE_DEP_PACKAGE_VAR: true
# #TEMPLATE_APPLICATION_NAME#:
# EXAMPLE_DB_USERNAME: my-postgres-user
# EXAMPLE_DB_ENDPOINT: postgres
18 changes: 0 additions & 18 deletions chart/templates/template-sso-secret.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,6 @@ metadata:
name: #TEMPLATE_APPLICATION_NAME#
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.sso.enabled }}
sso:
- name: #TEMPLATE_APPLICATION_DISPLAY_NAME# Login
clientId: uds-package-#TEMPLATE_APPLICATION_NAME#
redirectUris:
- "https://#TEMPLATE_APPLICATION_NAME#.{{ .Values.domain }}/oauth2/callback/saml"
protocol: saml
defaultClientScopes:
- "mapper-saml-email-email"
- "mapper-saml-username-login"
- "mapper-saml-username-name"

attributes:
saml.client.signature: "false"

secretName: {{ .Values.sso.secretName }}
# This secret template configures sso for the application. Will need updated based on application required configuration
secretTemplate:
#TEMPLATE_APPLICATION_NAME#.sso.config.key: |
example.auth.saml.enabled: {{ .Values.sso.enabled }}
example.auth.saml.applicationId: clientField(clientId)
example.auth.saml.providerName: {{ .Values.sso.saml.providerName }}
example.auth.saml.providerId: https://sso.{{ .Values.domain }}/realms/uds
example.auth.saml.loginUrl: https://sso.{{ .Values.domain }}/realms/uds/protocol/saml
example.auth.saml.user.login: login
example.auth.saml.user.name: name
example.auth.saml.user.email: email
example.auth.saml.certificate.secured: clientField(samlIdpCertificate)
{{- end }}
# Customize network policies and expose services via istio
network:
serviceMesh:
Expand Down
25 changes: 1 addition & 24 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# Example values from UDS package repo template
domain: "###ZARF_VAR_DOMAIN###"
sso:
enabled: false
protocol: saml
secretName: #TEMPLATE_APPLICATION_NAME#-sso
adminGroups: ["/#TEMPLATE_APPLICATION_DISPLAY_NAME# Admin", "/UDS Core/Admin"]
saml:
providerName: "#TEMPLATE_APPLICATION_DISPLAY_NAME#"
# Support for custom `network.allow` entries on the Package CR
# https://uds.defenseunicorns.com/reference/configuration/uds-networking-configuration/#additional-network-allowances
additionalNetworkAllow: []
# # Notice no `remoteGenerated` field here on custom internal rule
# - direction: Ingress
# selector:
# app: jenkins
# remoteNamespace: jenkins
# remoteSelector:
# app: jenkins
# port: 8180
# description: "Ingress from Jenkins"
# # No `remoteNamespace`, `remoteSelector`, or `port` fields on rule to `remoteGenerated`
# - direction: Egress
# selector:
# app: webservice
# remoteGenerated: Anywhere
# description: "Egress from #TEMPLATE_APPLICATION_NAME#"
5 changes: 0 additions & 5 deletions common/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,3 @@ components:
version: 1.2.3
valuesFiles:
- ../values/common-values.yaml

# You only need onDeploy.after.wait.cluster actions for non-UDS resources — items Zarf can’t automatically interpret, such as:
# Custom CRDs from third-party operators that don’t use kstatus
# External systems like databases, services, or Helm hooks
# Reference example implementation: https://docs.zarf.dev/ref/actions/#wait-action-configuration
45 changes: 45 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,55 @@ tasks:
- task: deploy:test-bundle

# CI will execute the following (via uds-common/.github/workflows/callable-test.yaml) so they need to be here with these names
#### Template CI: Remove this comment, the below block, and the `ci-setup` under `test-install` when building a package ####
- name: ci-setup
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to README.md that this task has to be dropped

description: Populate template with podinfo values for CI validation
actions:
- cmd: |
set -e

APP_NAME="podinfo"
DISPLAY_NAME="Podinfo"
CHART_URL="oci://ghcr.io/stefanprodan/charts/podinfo"
CHART_VERSION="6.7.1"
APP_IMAGE="ghcr.io/stefanprodan/podinfo:6.7.1"
APP_PORT="9898"

# Replace template placeholders across files
find . -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.ts" -o -name "*.json" -o -name "*.md" \) \
-not -path "./.git/*" -not -path "*/node_modules/*" -print0 | \
xargs -0 perl -pi -e "
s/#TEMPLATE_APPLICATION_NAME#/${APP_NAME}/g;
s/#TEMPLATE_APPLICATION_DISPLAY_NAME#/${DISPLAY_NAME}/g;
s|#TEMPLATE_CHART_REPO#|${CHART_URL}|g;
s|#UDS_PACKAGE_REPO#|https://github.com/stefanprodan/podinfo|g;
"

# Patch common/zarf.yaml
yq -i ".components[0].charts[1].version = \"${CHART_VERSION}\"" common/zarf.yaml
yq -i 'del(.components[0].charts[1].gitPath)' common/zarf.yaml

# Patch zarf.yaml, set podinfo image
yq -i "(.components[] | select(.only.flavor == \"upstream\")).images = [\"${APP_IMAGE}\"]" zarf.yaml
yq -i 'del(.components[] | select(.only.flavor == "unicorn"))' zarf.yaml
yq -i 'del(.components[] | select(.only.flavor == "registry1"))' zarf.yaml
yq -i '.variables = [{"name": "DOMAIN", "default": "uds.dev"}]' zarf.yaml

# Patch uds-package.yaml, set port and allow-all network policy
perl -pi -e "s/port: 1234/port: ${APP_PORT}/" chart/templates/uds-package.yaml
perl -pi -e 's/remoteGenerated: IntraNamespace/remoteGenerated: Anywhere/g' chart/templates/uds-package.yaml

# Rename template test file
mv tests/template-application-name.test.ts "tests/${APP_NAME}.test.ts" 2>/dev/null || true

echo "CI setup complete: template populated with ${APP_NAME} values"

#### Template CI: Remove this comment, the above block, and the `ci-setup` under `test-install` when building a package ####

- name: test-install
description: Test deploying the current branch to a new cluster
actions:
- task: ci-setup
- task: create-dev-package
- task: setup:k3d-test-cluster
- task: create-deploy-test-bundle
Expand Down
87 changes: 27 additions & 60 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ tasks:
- name: all
actions:
- task: health-check
# - task: custom-resource-test
- task: ingress
- task: ui
# - task: ingress
# - task: ui

# Ensure application deploys successfully and becomes available
- name: health-check
Expand All @@ -20,62 +19,30 @@ tasks:
namespace: #TEMPLATE_APPLICATION_NAME#
condition: Available

# # If application manages custom resources, then test creating custom resources
# - name: custom-resource-test
# description: Test creating a custom resource
# - name: ingress
# actions:
# # Create test zarf package
# - cmd: |
# ./uds zarf package create --confirm
# dir: tests/optional-example-zarf-tests
# # Generate some kind of test data. In this example it is a certificate
# - cmd: |
# openssl req -x509 -newkey rsa:4096 -keyout testCA.key \
# -out testCA.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"
# dir: tests/optional-example-zarf-tests
# # Deploy package with test data
# - cmd: |
# ./uds zarf package deploy \
# --set EXAMPLE_SECRET_VALUE="$(cat testCA.pem | base64 -w 0)" \
# zarf-package-example-zarf-tests-"${UDS_ARCH}"-0.0.1.tar.zst \
# --confirm
# dir: tests/optional-example-zarf-tests
# # Ensure expected resource is generated in some namespace. In this example it is checking for a configmap
# - description: Ensure configmap is created in target namespace
# wait:
# cluster:
# kind: configmap
# name: example-configmap
# namespace: example-ns
# # Cleanup files used to generate test data
# - cmd: |
# rm testCA.key testCA.pem
# dir: tests/optional-example-zarf-tests
# - description: #TEMPLATE_APPLICATION_DISPLAY_NAME# UI Status Check
# maxRetries: 30
# cmd: |
# STATUS=$(curl -L -o /dev/null -s -w "%{http_code}\n" https://#TEMPLATE_APPLICATION_NAME#.uds.dev)
# echo "#TEMPLATE_APPLICATION_DISPLAY_NAME# system status: ${STATUS}"
# if [ "$STATUS" != "200" ]; then
# sleep 10
# exit 1
# fi

- name: ingress
actions:
- description: #TEMPLATE_APPLICATION_DISPLAY_NAME# UI Status Check
maxRetries: 30
cmd: |
STATUS=$(curl -L -o /dev/null -s -w "%{http_code}\n" https://#TEMPLATE_APPLICATION_NAME#.uds.dev)
echo "#TEMPLATE_APPLICATION_DISPLAY_NAME# system status: ${STATUS}"
if [ "$STATUS" != "200" ]; then
sleep 10
exit 1
fi

- name: ui
description: #TEMPLATE_APPLICATION_DISPLAY_NAME# UI Checks
actions:
- cmd: |
docker run --rm \
--network=host \
--shm-size=1g \
--security-opt seccomp=unconfined \
--user "$(id -u):$(id -g)" \
-e HOME=/tmp \
-e NPM_CONFIG_CACHE=/tmp/.npm \
-v "$(pwd)":/app -w /app \
mcr.microsoft.com/playwright:v1.58.2 \
bash -lc "npm ci && npx playwright test"
dir: tests
# - name: ui
# description: #TEMPLATE_APPLICATION_DISPLAY_NAME# UI Checks
# actions:
# - cmd: |
# docker run --rm \
# --network=host \
# --shm-size=1g \
# --security-opt seccomp=unconfined \
# --user "$(id -u):$(id -g)" \
# -e HOME=/tmp \
# -e NPM_CONFIG_CACHE=/tmp/.npm \
# -v "$(pwd)":/app -w /app \
# mcr.microsoft.com/playwright:v1.58.2 \
# bash -lc "npm ci && npx playwright test"
# dir: tests

This file was deleted.

11 changes: 0 additions & 11 deletions tests/optional-example-zarf-tests/example-secret.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions tests/optional-example-zarf-tests/zarf.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions values/common-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,3 @@
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# Values common to all flavors

# Example variables from UDS package repo template. Update to relevant variables after templating
# imagePullSecrets:
# - name: "private-registry"

# postgresql:
# enabled: false
# postgresqlServer: ###ZARF_VAR_EXAMPLE_DB_ENDPOINT###
# existingSecret: "example-postgres"
# existingSecretPasswordKey: "password"
# postgresqlUsername: ###ZARF_VAR_EXAMPLE_DB_USERNAME###
# postgresqlDatabase: ###ZARF_VAR_EXAMPLE_DB_NAME###
# service:
# port: 5432
5 changes: 0 additions & 5 deletions values/registry1-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# Values for registry1 flavor

# Example variables from UDS package repo template. Update to relevant variables after templating
# image:
# repository: registry1.dso.mil/image
# tag: 1.2.3
5 changes: 0 additions & 5 deletions values/unicorn-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# Values for unicorn flavor

# Example variables from UDS package repo template. Update to relevant variables after templating
# image:
# repository: quay.io/rfcurated
# tag: 1.2.3
5 changes: 0 additions & 5 deletions values/upstream-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

# Values for upstream flavor

# Example variables from UDS package repo template. Update to relevant variables after templating
# image:
# repository: upstream/image
# tag: 1.2.3
Loading
Loading