feat(common): Merge common library into this repo (#27272)

**Description**
This PR moves the common-library charts back into this repo.

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):` or `chore(chart-name):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: TrueCharts-Bot <bot@truecharts.org>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: TrueCharts-Admin <bot@truecharts.org>
Co-authored-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Co-authored-by: Stavros kois <s.kois@outlook.com>
Co-authored-by: ばか雪 <165359296+bakayukii@users.noreply.github.com>
Co-authored-by: Tete17 <miguel_tete17@hotmail.com>
Co-authored-by: Matthew Salazar <matthew@mtslzr.io>
This commit is contained in:
Kjeld Schouten
2024-10-04 12:51:08 +02:00
committed by GitHub
co-authored by Stavros Kois TrueCharts-Admin Kjeld Schouten Stavros kois ばか雪 Tete17 Matthew Salazar
parent 859b00cf28
commit 2d0dd14947
500 changed files with 52613 additions and 0 deletions
@@ -0,0 +1,110 @@
suite: volsync replication dest metadata test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with replication dest created with labels and annotations
set:
label1: label1
label2: global_label2
annotation1: annotation1
annotation2: global_annotation2
global:
labels:
g_label1: global_label1
g_label2: "{{ .Values.label2 }}"
annotations:
g_annotation1: global_annotation1
g_annotation2: "{{ .Values.annotation2 }}"
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup
type: restic
credentials: mys3
src:
enabled: false
dest:
enabled: true
labels:
label1: "{{ .Values.label1 }}"
label2: label2
annotations:
annotation1: "{{ .Values.annotation1 }}"
annotation2: annotation2
credentials:
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.annotations
value:
annotation1: annotation1
annotation2: annotation2
g_annotation1: global_annotation1
g_annotation2: global_annotation2
- documentIndex: *secretDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: test-release-name
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/name: common-test
app.kubernetes.io/instance: test-release-name
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
g_label1: global_label1
g_label2: global_label2
label1: label1
label2: label2
- documentIndex: &replicationDestDoc 1
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: metadata.annotations
value:
annotation1: annotation1
annotation2: annotation2
g_annotation1: global_annotation1
g_annotation2: global_annotation2
- documentIndex: *replicationDestDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: test-release-name
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/name: common-test
app.kubernetes.io/instance: test-release-name
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
g_label1: global_label1
g_label2: global_label2
label1: label1
label2: label2
@@ -0,0 +1,80 @@
suite: volsync replication dest name test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
src:
enabled: false
dest:
enabled: true
- name: mybackup2
type: restic
credentials: mys3
src:
enabled: false
dest:
enabled: true
credentials:
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-volsync-mybackup1
- documentIndex: &replicationDestDoc 1
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-mybackup1-dest
- documentIndex: &secretDoc 2
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-volsync-mybackup2
- documentIndex: &replicationDestDoc 3
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-mybackup2-dest
@@ -0,0 +1,246 @@
suite: volsync replication dest spec test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct spec
set:
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
dest:
enabled: true
src:
enabled: false
credentials: &credentials
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.name
value: test-release-name-common-test-destbackup-volsync-mybackup1
- documentIndex: *secretDoc
equal:
path: stringData
value:
AWS_ACCESS_KEY_ID: some-access-key
AWS_SECRET_ACCESS_KEY: some-secret-key
RESTIC_PASSWORD: some-key
RESTIC_REPOSITORY: s3:some-url/some-bucket/test-release-name/volsync/destbackup-volsync-mybackup1
- documentIndex: &replicationDestDoc 1
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: spec
value:
trigger:
manual: restore-once
restic:
repository: test-release-name-common-test-destbackup-volsync-mybackup1
copyMethod: Snapshot
capacity: 100Gi
accessModes:
- ReadWriteOnce
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- it: should generate correct spec with changed defaults
set:
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: true
capacity: 200Gi
src:
enabled: false
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: spec
value:
trigger:
manual: restore-once
restic:
repository: test-release-name-common-test-destbackup-volsync-mybackup1
copyMethod: Clone
capacity: 200Gi
accessModes:
- ReadWriteOnce
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- it: should generate correct spec with storageClassName
set:
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: true
storageClassName: somestorageclass
src:
enabled: false
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: spec
value:
trigger:
manual: restore-once
restic:
repository: test-release-name-common-test-destbackup-volsync-mybackup1
copyMethod: Clone
capacity: 100Gi
accessModes:
- ReadWriteOnce
storageClassName: somestorageclass
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- it: should generate correct spec with volumeSnapshotClass
set:
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: true
volumeSnapshotClassName: somevsc
src:
enabled: false
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: spec
value:
trigger:
manual: restore-once
restic:
repository: test-release-name-common-test-destbackup-volsync-mybackup1
copyMethod: Clone
capacity: 100Gi
accessModes:
- ReadWriteOnce
volumeSnapshotClassName: somevsc
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- it: should generate correct spec with volumeSnapshotClass and StorageClass
set:
persistence:
destbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: true
storageClassName: somestorageclass
volumeSnapshotClassName: somevsc
src:
enabled: false
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationDestination
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
equal:
path: spec
value:
trigger:
manual: restore-once
restic:
repository: test-release-name-common-test-destbackup-volsync-mybackup1
copyMethod: Clone
capacity: 100Gi
accessModes:
- ReadWriteOnce
storageClassName: somestorageclass
volumeSnapshotClassName: somevsc
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
@@ -0,0 +1,110 @@
suite: volsync replication source metadata test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with replication source created with labels and annotations
set:
label1: label1
label2: global_label2
annotation1: annotation1
annotation2: global_annotation2
global:
labels:
g_label1: global_label1
g_label2: "{{ .Values.label2 }}"
annotations:
g_annotation1: global_annotation1
g_annotation2: "{{ .Values.annotation2 }}"
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup
type: restic
credentials: mys3
src:
enabled: true
dest:
enabled: false
labels:
label1: "{{ .Values.label1 }}"
label2: label2
annotations:
annotation1: "{{ .Values.annotation1 }}"
annotation2: annotation2
credentials:
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.annotations
value:
annotation1: annotation1
annotation2: annotation2
g_annotation1: global_annotation1
g_annotation2: global_annotation2
- documentIndex: *secretDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: test-release-name
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/name: common-test
app.kubernetes.io/instance: test-release-name
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
g_label1: global_label1
g_label2: global_label2
label1: label1
label2: label2
- documentIndex: &replicationSourceDoc 1
isKind:
of: ReplicationSource
- documentIndex: *replicationSourceDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationSourceDoc
equal:
path: metadata.annotations
value:
annotation1: annotation1
annotation2: annotation2
g_annotation1: global_annotation1
g_annotation2: global_annotation2
- documentIndex: *replicationSourceDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: test-release-name
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/name: common-test
app.kubernetes.io/instance: test-release-name
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
g_label1: global_label1
g_label2: global_label2
label1: label1
label2: label2
@@ -0,0 +1,80 @@
suite: volsync replication source name test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct name
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
src:
enabled: true
dest:
enabled: false
- name: mybackup2
type: restic
credentials: mys3
src:
enabled: true
dest:
enabled: false
credentials:
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-volsync-mybackup1
- documentIndex: &replicationSourceDoc 1
isKind:
of: ReplicationSource
- documentIndex: *replicationSourceDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationSourceDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-mybackup1
- documentIndex: &secretDoc 2
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-volsync-mybackup2
- documentIndex: &replicationSourceDoc 3
isKind:
of: ReplicationSource
- documentIndex: *replicationSourceDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationSourceDoc
equal:
path: metadata.name
value: test-release-name-common-test-srcbackup-mybackup2
@@ -0,0 +1,329 @@
suite: volsync replication src spec test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should generate correct spec
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
dest:
enabled: false
src:
enabled: true
credentials: &credentials
mys3:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- documentIndex: &secretDoc 0
isKind:
of: Secret
- documentIndex: *secretDoc
isAPIVersion:
of: v1
- documentIndex: *secretDoc
equal:
path: stringData
value:
AWS_ACCESS_KEY_ID: some-access-key
AWS_SECRET_ACCESS_KEY: some-secret-key
RESTIC_PASSWORD: some-key
RESTIC_REPOSITORY: s3:some-url/some-bucket/test-release-name/volsync/srcbackup-volsync-mybackup1
- documentIndex: &replicationDestDoc 1
isKind:
of: ReplicationSource
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
isSubset:
path: spec
content:
sourcePVC: test-release-name-common-test-srcbackup
trigger:
schedule: "0 0 * * *"
- documentIndex: *replicationDestDoc
isSubset:
path: spec.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Snapshot
pruneIntervalDays: 7
retain:
hourly: 24
daily: 7
weekly: 5
accessModes:
- ReadWriteOnce
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- documentIndex: *replicationDestDoc
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"
- it: should generate correct spec with changed defaults
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: false
src:
enabled: true
trigger:
schedule: "1 0 * * *"
retain:
hourly: 20
daily: 5
weekly: 3
pruneIntervalDays: 5
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationSource
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
isSubset:
path: spec
content:
sourcePVC: test-release-name-common-test-srcbackup
trigger:
schedule: "1 0 * * *"
- documentIndex: *replicationDestDoc
isSubset:
path: spec.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
pruneIntervalDays: 5
retain:
hourly: 20
daily: 5
weekly: 3
accessModes:
- ReadWriteOnce
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- documentIndex: *replicationDestDoc
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"
- it: should generate correct spec with storageClassName
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: false
src:
enabled: true
storageClassName: somestorageclass
trigger:
schedule: "1 0 * * *"
retain:
hourly: 20
daily: 5
weekly: 3
pruneIntervalDays: 5
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationSource
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
isSubset:
path: spec
content:
sourcePVC: test-release-name-common-test-srcbackup
trigger:
schedule: "1 0 * * *"
- documentIndex: *replicationDestDoc
isSubset:
path: spec.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
pruneIntervalDays: 5
retain:
hourly: 20
daily: 5
weekly: 3
accessModes:
- ReadWriteOnce
storageClassName: somestorageclass
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- documentIndex: *replicationDestDoc
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"
- it: should generate correct spec with volumeSnapshotClass
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: false
src:
enabled: true
volumeSnapshotClassName: somevsc
trigger:
schedule: "1 0 * * *"
retain:
hourly: 20
daily: 5
weekly: 3
pruneIntervalDays: 5
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationSource
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
isSubset:
path: spec
content:
sourcePVC: test-release-name-common-test-srcbackup
trigger:
schedule: "1 0 * * *"
- documentIndex: *replicationDestDoc
isSubset:
path: spec.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
pruneIntervalDays: 5
retain:
hourly: 20
daily: 5
weekly: 3
accessModes:
- ReadWriteOnce
volumeSnapshotClassName: somevsc
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- documentIndex: *replicationDestDoc
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"
- it: should generate correct spec with volumeSnapshotClass and StorageClass
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
dest:
enabled: false
src:
enabled: true
storageClassName: somestorageclass
volumeSnapshotClassName: somevsc
trigger:
schedule: "1 0 * * *"
retain:
hourly: 20
daily: 5
weekly: 3
pruneIntervalDays: 5
credentials: *credentials
asserts:
- documentIndex: *replicationDestDoc
isKind:
of: ReplicationSource
- documentIndex: *replicationDestDoc
isAPIVersion:
of: volsync.backube/v1alpha1
- documentIndex: *replicationDestDoc
isSubset:
path: spec
content:
sourcePVC: test-release-name-common-test-srcbackup
trigger:
schedule: "1 0 * * *"
- documentIndex: *replicationDestDoc
isSubset:
path: spec.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
pruneIntervalDays: 5
retain:
hourly: 20
daily: 5
weekly: 3
accessModes:
- ReadWriteOnce
storageClassName: somestorageclass
volumeSnapshotClassName: somevsc
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
- documentIndex: *replicationDestDoc
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"
@@ -0,0 +1,226 @@
suite: volsync validation test
templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should fail with empty name
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backed-up
volsync:
- name: ""
type: restic
credentials: my-secret
src:
enabled: true
dest:
enabled: false
credentials: {}
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [name]
- it: should fail with empty credentials
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: restic
credentials: ""
src:
enabled: true
dest:
enabled: false
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [credentials]
- it: should fail if referenced credentials does not exist
set:
persistence: &persistence
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: restic
credentials: my-secret
src:
enabled: true
dest:
enabled: false
credentials:
my-other-secret:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- failedTemplate:
errorMessage: VolSync - Expected credentials [my-secret] to be defined in [credentials] which currently contains [my-other-secret] keys
- it: should fail if credentials.url is empty
set:
persistence: *persistence
credentials:
my-secret:
type: s3
url: ""
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [url] in [credentials.my-secret]
- it: should fail if credentials.bucket is empty
set:
persistence: *persistence
credentials:
my-secret:
type: s3
url: some-url
bucket: ""
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [bucket] in [credentials.my-secret]
- it: should fail if credentials.encrKey is empty
set:
persistence: *persistence
credentials:
my-secret:
type: s3
url: some-url
bucket: some-bucket
encrKey: ""
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [encrKey] in [credentials.my-secret]
- it: should fail if credentials.accessKey is empty
set:
persistence: *persistence
credentials:
my-secret:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: ""
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [accessKey] in [credentials.my-secret]
- it: should fail if credentials.secretKey is empty
set:
persistence: *persistence
credentials:
my-secret:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: ""
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [secretKey] in [credentials.my-secret]
- it: should fail with invalid copy method
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: restic
credentials: my-secret
copyMethod: invalid
src:
enabled: true
dest:
enabled: false
credentials: &credentials
my-secret:
type: s3
url: some-url
bucket: some-bucket
encrKey: some-key
accessKey: some-access-key
secretKey: some-secret-key
asserts:
- failedTemplate:
errorMessage: VolSync - Expected [copyMethod] to be one of [Clone, Direct, Snapshot], but got [invalid]
- it: should fail with empty type
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: ""
credentials: my-secret
src:
enabled: true
dest:
enabled: false
asserts:
- failedTemplate:
errorMessage: VolSync - Expected non-empty [type]
- it: should fail with invalid type
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: invalid
credentials: my-secret
src:
enabled: true
dest:
enabled: false
credentials: *credentials
asserts:
- failedTemplate:
errorMessage: VolSync - Expected [type] to be one of [restic], but got [invalid]
- it: should fail with invalid credentials type
set:
persistence:
src-backup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: my-backup
type: restic
credentials: my-creds
src:
enabled: true
dest:
enabled: false
credentials:
my-creds:
type: invalid
asserts:
- failedTemplate:
errorMessage: VolSync - Expected [type] in [credentials.my-creds] to be one of [s3], but got [invalid]