-
Notifications
You must be signed in to change notification settings - Fork 22
59 lines (55 loc) · 2.4 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Test
on:
- pull_request
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
KEYSTORE_COMMON_NAME: keystore-${{ github.sha }}
TRUSTSTORE_COMMON_NAME: truststore-${{ github.sha }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: .
tags: java-spiffe-helper:test
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: helm/kind-action@v1
with:
cluster_name: kind
- run: kind load docker-image java-spiffe-helper:test --name kind
- run: helm upgrade --install -n spire-server spire-crds spire-crds --repo https://spiffe.github.io/helm-charts-hardened/ --create-namespace
- run: |
helm upgrade --install -n spire-server spire spire \
--repo https://spiffe.github.io/helm-charts-hardened/ \
-f .github/tests/spire-values.yaml \
--set spire-server.ca_subject.common_name="$TRUSTSTORE_COMMON_NAME" \
--set spire-server.controllerManager.identities.clusterSPIFFEIDs.java-spiffe-helper.dnsNameTemplates[0]="$KEYSTORE_COMMON_NAME"
- run: kubectl apply -f .github/tests/java-spiffe-helper.yaml
- run: kubectl wait pod/java-spiffe-helper --for condition=Ready --timeout=90s
- if: ${{ failure() }}
run: kubectl logs pod/java-spiffe-helper > java-spiffe-helper.log
- if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs
path: java-spiffe-helper.log
- if: ${{ failure() }}
run: kubectl describe pod/java-spiffe-helper
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- run: kubectl cp java-spiffe-helper:/tmp/keystore.p12 keystore.p12
- run: kubectl cp java-spiffe-helper:/tmp/truststore.p12 truststore.p12
- run: keytool -v -list -keystore keystore.p12 -storepass password | grep "CN=${{ env.KEYSTORE_COMMON_NAME }}"
- if: ${{ failure() }}
run: keytool -v -list -keystore keystore.p12 -storepass password
- run: keytool -v -list -keystore truststore.p12 -storepass password | grep "CN=${{ env.TRUSTSTORE_COMMON_NAME }}"
- if: ${{ failure() }}
run: keytool -v -list -keystore truststore.p12 -storepass password