Skip to content

Commit

Permalink
Merge pull request #23 from spiffe/test-non-defaulted-values
Browse files Browse the repository at this point in the history
Test charts without defaulted values
  • Loading branch information
kfox1111 authored Feb 23, 2023
2 parents 8a3ae10 + 5dc93da commit f149f2e
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/tests/no-spire-controller-manager/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spire-server:
controllerManager:
enabled: false
12 changes: 12 additions & 0 deletions .github/tests/spire-oidc-insecure/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
spiffe-oidc-discovery-provider:
enabled: true

insecureScheme:
enabled: true

config:
domains:
- oidc-discovery.example.org

acme:
tosAccepted: false
8 changes: 8 additions & 0 deletions .github/tests/upstream-authority-disk/create-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

BASEDIR=$(dirname "$0")

openssl req -new -x509 -days 365 -nodes -sha256 \
-subj "/C=NL/O=SPIFFE/OU=SPIRE/CN=example.org" \
-out "${BASEDIR}/example-org.pem" \
-keyout "${BASEDIR}/example-org.key"
28 changes: 28 additions & 0 deletions .github/tests/upstream-authority-disk/example-org.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC41hcad074AFQl
QiM9j54tuh1yCpRfO2pFPOwESqT/gYrnAMfl24nI28FaC/gZWmhD5VZrThY8QlLe
sk7iyDmrvB6VMMs5di40C5XE11FLf+efS1CpD9atqLyBQ1tjB0yZzIPZFP97HRI4
DQb7BXqgOmDEnJ5gk6IleBsomQlDwyu9TXgUd8c4SEFgrxHMjfybZN3dKzw4jCB3
SrEqouaSq7eelCe0q58y4Lq8fkD+Zc2GrRJ0K5y3eMoRzp5ByK8QYPm8AJgFVTS9
kCs+HROqC+Y7WqracUiEHCDWY1HG5I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j2ER93hhe3Ja8IX
R2wgVqwLUy2ezuTaWiU0H+9HUeHmv5WwAsZ9/ksPAoGBALmfyzS8J1jfkjMLhwvQ
vaS7UzPEufeJb/vg2WMd31TRc6fMcGZKwCvjE3z2xLewU+DwSynqjdRZn4mOt+sm
5LOMBdOTK6nEoVbGdCktYM8BpgxFSBaQ7oJDVRaHOOs7cauCOz7NCCd/e6q//S6L
wS6zVciWfFotxYTyTyj0WiiT
-----END PRIVATE KEY-----
19 changes: 19 additions & 0 deletions .github/tests/upstream-authority-disk/example-org.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDBDCCAewCCQCK4mz8rTwvHDANBgkqhkiG9w0BAQsFADBEMQswCQYDVQQGEwJO
TDEPMA0GA1UECgwGU1BJRkZFMQ4wDAYDVQQLDAVTUElSRTEUMBIGA1UEAwwLZXhh
bXBsZS5vcmcwHhcNMjMwMjIwMTAwNTA5WhcNMjQwMjIwMTAwNTA5WjBEMQswCQYD
VQQGEwJOTDEPMA0GA1UECgwGU1BJRkZFMQ4wDAYDVQQLDAVTUElSRTEUMBIGA1UE
AwwLZXhhbXBsZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4
1hcad074AFQlQiM9j54tuh1yCpRfO2pFPOwESqT/gYrnAMfl24nI28FaC/gZWmhD
5VZrThY8QlLesk7iyDmrvB6VMMs5di40C5XE11FLf+efS1CpD9atqLyBQ1tjB0yZ
zIPZFP97HRI4DQb7BXqgOmDEnJ5gk6IleBsomQlDwyu9TXgUd8c4SEFgrxHMjfyb
ZN3dKzw4jCB3SrEqouaSq7eelCe0q58y4Lq8fkD+Zc2GrRJ0K5y3eMoRzp5ByK8Q
YPm8AJgFVTS9kCs+HROqC+Y7WqracUiEHCDWY1HG5IbdC9GSNdPDu2GHUxFWtKhh
Pw+I7iuu3jF5LRikLtDpAgMBAAEwDQYJKoZIhvcNAQELBQADggEBACK0PQa7+2za
GOacBqbmeycEJmiSZYEi1sMbgjFjmROcW+wyzWZDvMlDSS2z22B6Cp7qS5ZY3T7H
ZMVbpRkkNMF9h+51cTFoUlppgFEEqIXRkE+Jejs5Fq2FvgSdx/2LJZkTzt4Rlo07
UiP4nlHhsEVPRNPuus/MfoA2RZYfGJt+4eLXqjS6TAcccfGqVcMmq/FjjZjzWY5w
gYXC5ID4NB54N7ag0iBltcZ+OnYWlhReTOxih9yZXq8lRzE2Ny5aA2ztM9YfDuYu
ATU9T+cfd9UTu8PPNPLuXLgVr1P+1JOApzq1EA0fjDq4L6FzMqgoumWFV3kXHwop
m27t/52Pu8U=
-----END CERTIFICATE-----
58 changes: 58 additions & 0 deletions .github/tests/upstream-authority-disk/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
server:
config:
upstreamAuthority:
disk:
enabled: true
secret:
data:
# This cert is generated using create-cert.sh and should only be used for the test
certificate: |
-----BEGIN CERTIFICATE-----
MIIDBDCCAewCCQCK4mz8rTwvHDANBgkqhkiG9w0BAQsFADBEMQswCQYDVQQGEwJO
TDEPMA0GA1UECgwGU1BJRkZFMQ4wDAYDVQQLDAVTUElSRTEUMBIGA1UEAwwLZXhh
bXBsZS5vcmcwHhcNMjMwMjIwMTAwNTA5WhcNMjQwMjIwMTAwNTA5WjBEMQswCQYD
VQQGEwJOTDEPMA0GA1UECgwGU1BJRkZFMQ4wDAYDVQQLDAVTUElSRTEUMBIGA1UE
AwwLZXhhbXBsZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4
1hcad074AFQlQiM9j54tuh1yCpRfO2pFPOwESqT/gYrnAMfl24nI28FaC/gZWmhD
5VZrThY8QlLesk7iyDmrvB6VMMs5di40C5XE11FLf+efS1CpD9atqLyBQ1tjB0yZ
zIPZFP97HRI4DQb7BXqgOmDEnJ5gk6IleBsomQlDwyu9TXgUd8c4SEFgrxHMjfyb
ZN3dKzw4jCB3SrEqouaSq7eelCe0q58y4Lq8fkD+Zc2GrRJ0K5y3eMoRzp5ByK8Q
YPm8AJgFVTS9kCs+HROqC+Y7WqracUiEHCDWY1HG5IbdC9GSNdPDu2GHUxFWtKhh
Pw+I7iuu3jF5LRikLtDpAgMBAAEwDQYJKoZIhvcNAQELBQADggEBACK0PQa7+2za
GOacBqbmeycEJmiSZYEi1sMbgjFjmROcW+wyzWZDvMlDSS2z22B6Cp7qS5ZY3T7H
ZMVbpRkkNMF9h+51cTFoUlppgFEEqIXRkE+Jejs5Fq2FvgSdx/2LJZkTzt4Rlo07
UiP4nlHhsEVPRNPuus/MfoA2RZYfGJt+4eLXqjS6TAcccfGqVcMmq/FjjZjzWY5w
gYXC5ID4NB54N7ag0iBltcZ+OnYWlhReTOxih9yZXq8lRzE2Ny5aA2ztM9YfDuYu
ATU9T+cfd9UTu8PPNPLuXLgVr1P+1JOApzq1EA0fjDq4L6FzMqgoumWFV3kXHwop
m27t/52Pu8U=
-----END CERTIFICATE-----
# This key is generated using create-cert.sh and should only be used for the test
key: |
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC41hcad074AFQl
QiM9j54tuh1yCpRfO2pFPOwESqT/gYrnAMfl24nI28FaC/gZWmhD5VZrThY8QlLe
sk7iyDmrvB6VMMs5di40C5XE11FLf+efS1CpD9atqLyBQ1tjB0yZzIPZFP97HRI4
DQb7BXqgOmDEnJ5gk6IleBsomQlDwyu9TXgUd8c4SEFgrxHMjfybZN3dKzw4jCB3
SrEqouaSq7eelCe0q58y4Lq8fkD+Zc2GrRJ0K5y3eMoRzp5ByK8QYPm8AJgFVTS9
kCs+HROqC+Y7WqracUiEHCDWY1HG5IbdC9GSNdPDu2GHUxFWtKhhPw+I7iuu3jF5
LRikLtDpAgMBAAECggEAQNS+98Z/SVd8LDFdgPs95RYRu+1gC2MgrDZpJjw0UXZT
jSDl/Iabdns1/2qRU/s09ROc0zhpbitpO7lZGAxYxhbOt0+NCJOeMx0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OTK6nEoVbGdCktYM8BpgxFSBaQ7oJDVRaHOOs7cauCOz7NCCd/e6q//S6L
wS6zVciWfFotxYTyTyj0WiiT
-----END PRIVATE KEY-----
36 changes: 33 additions & 3 deletions .github/workflows/helm-chart-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ on:
- 'charts/**'
- '.github/workflows/helm-chart-ci.yaml'
- '.github/kind/conf/kind-config.yaml'
- '.github/tests/**/*.yaml'
- 'helm-docs.sh'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
HELM_VERSION: v3.10.2
PYTHON_VERSION: 3.11.1
HELM_VERSION: v3.11.1
PYTHON_VERSION: 3.11.2
CHART_TESTING_VERSION: v3.7.1

jobs:
Expand Down Expand Up @@ -69,10 +70,34 @@ jobs:
outputs:
changed: ${{ steps.list-changed.outputs.changed }}

build-matrix:
name: Build matrix
runs-on: ubuntu-22.04

needs: [lint-chart]

if: needs.lint-chart.outputs.changed == 'true'

steps:
- name: Checkout
uses: actions/[email protected]

- id: set-matrix
name: Collect all tests
run: |
tests="$(echo -e "default\n$(find .github/tests -maxdepth 1 -type d | grep -Ev 'tests$' | xargs -I % basename % | sort | uniq)")"
tests_json="$(echo "$tests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')"
echo "tests=$tests_json" >> $GITHUB_OUTPUT
outputs:
tests: ${{ steps.set-matrix.outputs.tests }}

test:
runs-on: ubuntu-22.04

needs:
- lint-chart
- build-matrix

if: needs.lint-chart.outputs.changed == 'true'

Expand All @@ -89,6 +114,8 @@ jobs:
- v1.23.13
- v1.22.15
- v1.21.14
values:
- ${{ fromJson(needs.build-matrix.outputs.tests) }}

steps:
- name: Checkout
Expand Down Expand Up @@ -124,4 +151,7 @@ jobs:
run: |
ct install --debug \
--target-branch main \
--exclude-deprecated
--exclude-deprecated \
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=.github/tests/$VALUES/values.yaml"') || '' }}
env:
VALUES: ${{ matrix.values }}
4 changes: 2 additions & 2 deletions charts/spire/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: spire
description: >
A Helm chart for deploying the complete Spire stack including: spire-server, spire-agent, spiffe-csi-driver, spiffe-oidc-discovery-provider and spire-controller-manager.
type: application
version: 0.1.0
appVersion: "1.5.4"
version: 0.2.0
appVersion: "1.5.5"
keywords: ["spiffe", "spire", "spire-server", "spire-agent", "oidc", "spire-controller-manager"]
home: https://github.com/philips-labs/helm-charts/tree/main/charts/spire
sources:
Expand Down
3 changes: 2 additions & 1 deletion charts/spire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- This README.md is generated. Please edit README.md.gotmpl -->

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.4](https://img.shields.io/badge/AppVersion-1.5.4-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.5](https://img.shields.io/badge/AppVersion-1.5.5-informational?style=flat-square)

A Helm chart for deploying the complete Spire stack including: spire-server, spire-agent, spiffe-csi-driver, spiffe-oidc-discovery-provider and spire-controller-manager.

Expand Down Expand Up @@ -68,6 +68,7 @@ Kubernetes: `>=1.21.0-0`
| spire-agent.trustDomain | string | `"example.org"` | |
| spire-server.bundleConfigMap | string | `"spire-bundle"` | |
| spire-server.clusterName | string | `"example-cluster"` | |
| spire-server.controllerManager.enabled | bool | `true` | |
| spire-server.nameOverride | string | `"server"` | |
| spire-server.trustDomain | string | `"example.org"` | |

Expand Down
3 changes: 3 additions & 0 deletions charts/spire/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ spire-server:
clusterName: &clusterName "example-cluster"
trustDomain: &trustDomain "example.org"

controllerManager:
enabled: true

spire-agent:
nameOverride: agent
bundleConfigMap: *bundleConfigMap
Expand Down

0 comments on commit f149f2e

Please sign in to comment.