From 42591e54812e36d2b5618e47d30d9290cb69b22c Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Mon, 29 Apr 2024 23:33:51 +0200 Subject: [PATCH] fix: volsync requires accessModes in some cases (#799) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So lets just always supply the set accessmodes. **Description** ⚒️ Fixes # **⚙️ 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?** **📃 Notes:** **✔️ 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._ --- library/common/Chart.yaml | 2 +- .../class/volsync/_replicationDestination.tpl | 6 +++++- library/common/templates/lib/volsync/_storage.tpl | 13 +++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 4ec61db08..96f6c15b8 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,7 +15,7 @@ maintainers: name: common sources: null type: library -version: 22.0.2 +version: 22.0.3 annotations: artifacthub.io/category: "integration-delivery" artifacthub.io/license: "BUSL-1.1" diff --git a/library/common/templates/class/volsync/_replicationDestination.tpl b/library/common/templates/class/volsync/_replicationDestination.tpl index 95516c008..74a39ac56 100644 --- a/library/common/templates/class/volsync/_replicationDestination.tpl +++ b/library/common/templates/class/volsync/_replicationDestination.tpl @@ -38,8 +38,12 @@ spec: {{ $volsyncData.type }}: repository: {{ $volsyncData.repository }} copyMethod: {{ $volsyncData.copyMethod | default "Snapshot"}} - {{- with $volsyncData.dest.capacity }} + {{- if $volsyncData.dest.capacity }} capacity: {{ $volsyncData.dest.capacity }} + {{- else if $objectData.size }} + capacity: {{ $objectData.size }} + {{- else }} + capacity: {{ $rootCtx.Values.global.fallbackDefaults.pvcSize }} {{- end }} {{- include "tc.v1.common.lib.volsync.storage" (dict "rootCtx" $rootCtx "objectData" $objectData "volsyncData" $volsyncData "target" "dest") | trim | nindent 4 }} diff --git a/library/common/templates/lib/volsync/_storage.tpl b/library/common/templates/lib/volsync/_storage.tpl index f9f34395c..b24f49623 100644 --- a/library/common/templates/lib/volsync/_storage.tpl +++ b/library/common/templates/lib/volsync/_storage.tpl @@ -10,9 +10,18 @@ storageClassName: {{ . }} {{- end -}} - {{- with $target.accessModes }} accessModes: - {{- range . }} + {{- if $target.accessModes }} + + {{- range $target.accessModes }} + - {{ . }} + {{- end }} + {{- else if $objectData.accessModes }} + {{- range $objectData.accessModes }} + - {{ . }} + {{- end }} + {{- else }} + {{- range $rootCtx.Values.global.fallbackDefaults.accessModes }} - {{ . }} {{- end }} {{- end -}}