Skip to content

Commit

Permalink
fix(common): remove cleanup flags from source volsync (#30470)
Browse files Browse the repository at this point in the history
**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  #30469 

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [x] 🪛 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:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 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
- [x] ⚠️ My changes generate no new warnings
- [x] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [x] ⬆️ I increased versions for any altered app according to semantic
versioning
- [x] 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._
  • Loading branch information
stavros-k authored Dec 30, 2024
1 parent 888042d commit e197d3c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ tests:
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Snapshot
cleanupTempPVC: false
cleanupCachePVC: false
pruneIntervalDays: 7
retain:
hourly: 6
Expand Down Expand Up @@ -130,8 +128,6 @@ tests:
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
cleanupTempPVC: false
cleanupCachePVC: false
pruneIntervalDays: 5
retain:
hourly: 20
Expand Down Expand Up @@ -195,8 +191,6 @@ tests:
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
cleanupTempPVC: false
cleanupCachePVC: false
pruneIntervalDays: 5
retain:
hourly: 20
Expand Down Expand Up @@ -261,8 +255,6 @@ tests:
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
cleanupTempPVC: false
cleanupCachePVC: false
pruneIntervalDays: 5
retain:
hourly: 20
Expand Down Expand Up @@ -328,8 +320,6 @@ tests:
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
cleanupTempPVC: false
cleanupCachePVC: false
pruneIntervalDays: 5
retain:
hourly: 20
Expand All @@ -349,58 +339,3 @@ tests:
matchRegex:
path: spec.restic.unlock
pattern: "^[0-9]{14}$"

- it: should generate correct spec with cleanup flags
set:
persistence:
srcbackup:
enabled: true
type: pvc
mountPath: /backedup
volsync:
- name: mybackup1
type: restic
credentials: mys3
copyMethod: Clone
cleanupTempPVC: true
cleanupCachePVC: true
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.restic
content:
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
copyMethod: Clone
cleanupTempPVC: true
cleanupCachePVC: true
pruneIntervalDays: 5
retain:
hourly: 20
daily: 5
weekly: 3
monthly: 3
yearly: 1
accessModes:
- ReadWriteOnce
moverSecurityContext:
fsGroup: 568
runAsUser: 568
runAsGroup: 568
2 changes: 1 addition & 1 deletion charts/library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ sources:
- https://hub.docker.com/_/
- https://hub.docker.com/r/mikefarah/yq
type: library
version: 25.3.0
version: 25.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ objectData:
{{- $schedule = $volsyncData.src.trigger.schedule -}}
{{- end -}}

{{- $cleanupTempPVC := false -}}
{{- $cleanupCachePVC := false -}}
{{- if and (hasKey $volsyncData "cleanupTempPVC") (kindIs "bool" $volsyncData.cleanupTempPVC) -}}
{{- $cleanupTempPVC = $volsyncData.cleanupTempPVC -}}
{{- end -}}
{{- if and (hasKey $volsyncData "cleanupCachePVC") (kindIs "bool" $volsyncData.cleanupCachePVC) -}}
{{- $cleanupCachePVC = $volsyncData.cleanupCachePVC -}}
{{- end -}}

{{- $retain := dict "hourly" 6 "daily" 5 "weekly" 4 "monthly" 3 "yearly" 1 -}}
{{- if $volsyncData.src.retain -}}
{{- $items := list "hourly" "daily" "weekly" "monthly" "yearly" -}}
Expand Down Expand Up @@ -63,8 +54,6 @@ spec:
{{ $volsyncData.type }}:
repository: {{ $volsyncData.repository }}
copyMethod: {{ $volsyncData.copyMethod | default "Snapshot" }}
cleanupTempPVC: {{ $cleanupTempPVC }}
cleanupCachePVC: {{ $cleanupCachePVC }}
pruneIntervalDays: {{ $volsyncData.src.pruneIntervalDays | default 7 }}
unlock: {{ now | date "20060102150405" | quote }}
retain:
Expand Down

0 comments on commit e197d3c

Please sign in to comment.