Skip to content

Commit 82a1b44

Browse files
committed
test: Add PKCS#12 format volume + mount
1 parent 444c028 commit 82a1b44

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

tests/templates/kuttl/non-sensitive-data/02-assert.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ timeout: 10
55
commands:
66
# Ensure that the Pod comes up
77
- script: kubectl wait --for=condition=Ready pod/secret-consumer-$NAMESPACE --namespace "$NAMESPACE" --timeout 60s
8-
# Ensure there is only a single file in the target directory
9-
- script: kubectl exec secret-consumer-$NAMESPACE --namespace "$NAMESPACE" -- bash -c 'if [ $(ls -p /stackable/ca | grep -v / | wc -l) = "1" ]; then echo "Success"; else exit 1; fi'
8+
# Ensure there is only a single file in the target directories
9+
- script: kubectl exec secret-consumer-$NAMESPACE --namespace "$NAMESPACE" -- bash -c 'if [ $(ls -p /stackable/ca/pem | grep -v / | wc -l) = "1" ]; then echo "Success"; else exit 1; fi'
10+
- script: kubectl exec secret-consumer-$NAMESPACE --namespace "$NAMESPACE" -- bash -c 'if [ $(ls -p /stackable/ca/pkcs12 | grep -v / | wc -l) = "1" ]; then echo "Success"; else exit 1; fi'

tests/templates/kuttl/non-sensitive-data/02_pod.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
securityContext:
99
fsGroup: 1000
1010
volumes:
11-
- name: ca
11+
- name: ca-pem
1212
ephemeral:
1313
volumeClaimTemplate:
1414
metadata:
@@ -25,11 +25,30 @@ spec:
2525
resources:
2626
requests:
2727
storage: "1"
28+
- name: ca-pkcs12
29+
ephemeral:
30+
volumeClaimTemplate:
31+
metadata:
32+
annotations:
33+
secrets.stackable.tech/class: root-trust-$NAMESPACE
34+
# Only non-sensitive data is needed
35+
secrets.stackable.tech/only-provision-identity: "true"
36+
# Explicitly request a format to trigger parsing in the secret-operator
37+
secrets.stackable.tech/format: tls-pkcs12
38+
spec:
39+
storageClassName: secrets.stackable.tech
40+
accessModes:
41+
- ReadWriteOnce
42+
resources:
43+
requests:
44+
storage: "1"
2845
containers:
2946
- name: test
3047
image: oci.stackable.tech/sdp/testing-tools:0.3.0-stackable0.0.0-dev
3148
stdin: true
3249
tty: true
3350
volumeMounts:
34-
- name: ca
35-
mountPath: /stackable/ca
51+
- name: ca-pem
52+
mountPath: /stackable/ca/pem
53+
- name: ca-pkcs12
54+
mountPath: /stackable/ca/pkcs12

0 commit comments

Comments
 (0)