Skip to content

Commit f9f7d53

Browse files
committed
test for plugin configuration passthrough
Signed-off-by: Itay Grudev <itay@verito.digital>
1 parent 46087c6 commit f9f7d53

5 files changed

Lines changed: 149 additions & 0 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: postgresql.cnpg.io/v1
2+
kind: Cluster
3+
metadata:
4+
name: barman-plugin-explicit-config-cluster
5+
spec:
6+
plugins:
7+
- name: foo.example.com
8+
enabled: true
9+
isWALArchiver: false
10+
parameters:
11+
foo: bar
12+
- name: barman-cloud.cloudnative-pg.io
13+
enabled: true
14+
isWALArchiver: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
type: postgresql
2+
mode: standalone
3+
cluster:
4+
instances: 1
5+
storage:
6+
size: 256Mi
7+
plugins:
8+
- name: foo.example.com
9+
enabled: true
10+
isWALArchiver: false
11+
parameters:
12+
foo: bar
13+
- name: barman-cloud.cloudnative-pg.io
14+
enabled: true
15+
isWALArchiver: true
16+
17+
backups:
18+
enabled: true
19+
method: plugin
20+
pluginConfiguration:
21+
name: barman-cloud.cloudnative-pg.io
22+
provider: s3
23+
endpointURL: "https://minio.minio.svc.cluster.local"
24+
endpointCA:
25+
name: kube-root-ca.crt
26+
key: ca.crt
27+
wal:
28+
encryption: ""
29+
data:
30+
encryption: ""
31+
s3:
32+
bucket: "mybucket"
33+
path: "/barman-plugin-scheduledbackups/v1"
34+
accessKey: "minio"
35+
secretKey: "minio123"
36+
region: "local"
37+
retentionPolicy: "30d"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: postgresql.cnpg.io/v1
2+
kind: Cluster
3+
metadata:
4+
name: barman-plugin-config-override-cluster
5+
spec:
6+
plugins:
7+
- name: foo.example.com
8+
enabled: true
9+
isWALArchiver: false
10+
parameters:
11+
foo: bar
12+
- name: barman-cloud.cloudnative-pg.io
13+
enabled: false
14+
isWALArchiver: false
15+
parameters:
16+
foo: bar
17+
barmanObjectName: asd
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
type: postgresql
2+
mode: standalone
3+
cluster:
4+
instances: 1
5+
storage:
6+
size: 256Mi
7+
plugins:
8+
- name: foo.example.com
9+
enabled: true
10+
isWALArchiver: false
11+
parameters:
12+
foo: bar
13+
- name: barman-cloud.cloudnative-pg.io
14+
enabled: false
15+
isWALArchiver: false
16+
parameters:
17+
foo: bar
18+
barmanObjectName: asd
19+
20+
backups:
21+
enabled: true
22+
method: plugin
23+
pluginConfiguration:
24+
name: barman-cloud.cloudnative-pg.io
25+
provider: s3
26+
endpointURL: "https://minio.minio.svc.cluster.local"
27+
endpointCA:
28+
name: kube-root-ca.crt
29+
key: ca.crt
30+
wal:
31+
encryption: ""
32+
data:
33+
encryption: ""
34+
s3:
35+
bucket: "mybucket"
36+
path: "/barman-plugin-scheduledbackups/v1"
37+
accessKey: "minio"
38+
secretKey: "minio123"
39+
region: "local"
40+
retentionPolicy: "30d"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Tests the Barman Cloud CNPG-I Plugin with explicit plugin configuration
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
name: barman-plugin-explicit
6+
spec:
7+
timeouts:
8+
apply: 1s
9+
assert: 5s
10+
cleanup: 1m
11+
steps:
12+
- name: Install a cluster with a custom plugin section
13+
try:
14+
- script:
15+
content: |
16+
helm upgrade \
17+
--install \
18+
--namespace $NAMESPACE \
19+
--values ./01-barman_plugin_explicit_config_cluster.yaml \
20+
--wait \
21+
barman-plugin-explicit-config ../../
22+
- assert:
23+
file: ./01-barman_plugin_explicit_config_cluster-assert.yaml
24+
- name: Install the cluster with a custom plugin section that overrides the default configuration
25+
try:
26+
- script:
27+
content: |
28+
helm upgrade \
29+
--install \
30+
--namespace $NAMESPACE \
31+
--values ./02-barman_plugin_config_override_cluster.yaml \
32+
--wait \
33+
barman-plugin-config-override ../../
34+
- assert:
35+
file: ./02-barman_plugin_config_override_cluster-assert.yaml
36+
- name: Cleanup
37+
try:
38+
- script:
39+
content: |
40+
helm --namespace $NAMESPACE uninstall barman-plugin-explicit-config
41+
helm --namespace $NAMESPACE uninstall barman-plugin-config-override

0 commit comments

Comments
 (0)