From 2b69f20d6ae1f7821a186016a543cda99cbc5113 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 24 Feb 2024 10:54:03 +0100 Subject: [PATCH] chore: BREAKING CHANGE remove ixvolumes (#710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** We don't use ixVolumes and it's a platform specific shithole **โš™๏ธ Type of change** - [ ] โš™๏ธ Feature/App addition - [ ] ๐Ÿช› Bugfix - [x] โš ๏ธ 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 **โž• 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._ --------- Co-authored-by: Stavros kois --- features_capability.json | 54 ------ library/common-test/Chart.yaml | 2 +- .../tests/addons/autoperms_test.yaml | 48 +---- .../tests/persistence/validation_test.yaml | 2 +- .../tests/pod/volume_ixVolume_test.yaml | 179 ------------------ library/common/templates/lib/pod/_volumes.tpl | 2 - .../templates/lib/pod/volumes/_ixVolume.tpl | 56 ------ .../templates/lib/storage/_validation.tpl | 2 +- .../common/templates/lib/util/_autoperms.tpl | 2 +- library/common/values.yaml | 6 - 10 files changed, 5 insertions(+), 348 deletions(-) delete mode 100644 features_capability.json delete mode 100644 library/common-test/tests/pod/volume_ixVolume_test.yaml delete mode 100644 library/common/templates/lib/pod/volumes/_ixVolume.tpl diff --git a/features_capability.json b/features_capability.json deleted file mode 100644 index bb97e92c..00000000 --- a/features_capability.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "normalize/interfaceConfiguration": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.10-MASTER-somever"} - }, - "normalize/ixVolume": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.10-MASTER-somever"} - }, - "definitions/interface": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.10-MASTER-somever"} - }, - "definitions/gpuConfiguration": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.10-MASTER-somever"} - }, - "definitions/timezone": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.12-MASTER"} - }, - "definitions/nodeIP": { - "stable": {"min": "20.12-ALPHA"}, - "nightlies": {"min": "20.12-MASTER"} - }, - "definitions/certificate": { - "stable": {"min": "21.04-ALPHA"}, - "nightlies": {"min": "21.02-MASTER"} - }, - "definitions/certificateAuthority": { - "stable": {"min": "21.04-ALPHA"}, - "nightlies": {"min": "21.02-MASTER"} - }, - "validations/containerImage": { - "stable": {"min": "21.06-BETA"}, - "nightlies": {"min": "21.04-MASTER"} - }, - "validations/nodePort": { - "stable": {"min": "21.04-ALPHA"}, - "nightlies": {"min": "21.04-MASTER"} - }, - "validations/hostPath": { - "stable": {"min": "22.02"}, - "nightlies": {"min": "22.02.1-MASTER"} - }, - "validations/lockedHostPath": { - "stable": {"min": "22.02"}, - "nightlies": {"min": "22.02.1-MASTER"} - }, - "validations/hostPathAttachments": { - "stable": {"min": "22.02"}, - "nightlies": {"min": "22.02.1-MASTER"} - } -} diff --git a/library/common-test/Chart.yaml b/library/common-test/Chart.yaml index acd5543b..f2298282 100644 --- a/library/common-test/Chart.yaml +++ b/library/common-test/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "" dependencies: - name: common repository: file://../common - version: ~18.0.0 + version: ~17.5.0 deprecated: false description: Helper chart to test different use cases of the common library home: https://github.com/truecharts/apps/tree/master/charts/library/common-test diff --git a/library/common-test/tests/addons/autoperms_test.yaml b/library/common-test/tests/addons/autoperms_test.yaml index 9fb7fcfb..110fdc40 100644 --- a/library/common-test/tests/addons/autoperms_test.yaml +++ b/library/common-test/tests/addons/autoperms_test.yaml @@ -333,8 +333,6 @@ tests: namespace: ix-namespace ixChartContext: some: context - ixVolumes: - - hostPath: /mnt/pool/ix-applications/test persistence: test1: enabled: true @@ -400,16 +398,6 @@ tests: chmod: 770 recursive: true mountPath: /test7 - test8: - enabled: true - type: ixVolume - datasetName: test - autoPermissions: - enabled: true - chown: true - chmod: 770 - recursive: true - mountPath: /test8 test9: enabled: true type: nfs @@ -419,13 +407,6 @@ tests: enabled: true chown: true mountPath: /test9 - # Should not show up, without enabled true - test10: - type: ixVolume - datasetName: test - autoPermissions: - chown: true - mountPath: /test10 asserts: - documentIndex: *jobDoc isKind: @@ -490,13 +471,6 @@ tests: content: name: test7 emptyDir: {} - - documentIndex: *jobDoc - contains: - path: spec.template.spec.volumes - content: - name: test8 - hostPath: - path: /mnt/pool/ix-applications/test - documentIndex: *jobDoc contains: path: spec.template.spec.volumes @@ -555,13 +529,6 @@ tests: name: test7 mountPath: /mounts/test7 readOnly: false - - documentIndex: *jobDoc - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: test8 - mountPath: /mounts/test8 - readOnly: false - documentIndex: *jobDoc contains: path: spec.template.spec.containers[0].volumeMounts @@ -656,19 +623,6 @@ tests: echo "Ownership before: [$before]" echo "Ownership after: [$(stat -c "%u:%g" /mounts/test7)]" echo "" - echo "Automatically correcting permissions for /mounts/test8..." - before=$(stat -c "%a" /mounts/test8) - chmod -R 770 /mounts/test8 || echo "Failed setting permissions using chmod..." - echo "Permissions before: [$before]" - echo "Permissions after: [$(stat -c "%a" /mounts/test8)]" - echo "" - echo "Automatically correcting ownership for /mounts/test8..." - before=$(stat -c "%u:%g" /mounts/test8) - /usr/sbin/nfs4xdr_winacl -a chown -G 568 -r -c "/mounts/test8" -p "/mounts/test8" || echo "Failed setting ownership using winacl..." - - echo "Ownership before: [$before]" - echo "Ownership after: [$(stat -c "%u:%g" /mounts/test8)]" - echo "" echo "Automatically correcting ownership for /mounts/test9..." before=$(stat -c "%u:%g" /mounts/test9) /usr/sbin/nfs4xdr_winacl -a chown -G 568 -c "/mounts/test9" -p "/mounts/test9" || echo "Failed setting ownership using winacl..." @@ -755,7 +709,7 @@ tests: chown: true asserts: - failedTemplate: - errorMessage: Auto Permissions - Allowed persistent types for auto permissions are [hostPath, emptyDir, nfs, ixVolume], but got [device] on [test] + errorMessage: Auto Permissions - Allowed persistent types for auto permissions are [hostPath, emptyDir, nfs], but got [device] on [test] - it: should fail trying to set permissions on readOnly set: diff --git a/library/common-test/tests/persistence/validation_test.yaml b/library/common-test/tests/persistence/validation_test.yaml index fd33a7a6..734d9a81 100644 --- a/library/common-test/tests/persistence/validation_test.yaml +++ b/library/common-test/tests/persistence/validation_test.yaml @@ -43,7 +43,7 @@ tests: type: not-a-type asserts: - failedTemplate: - errorMessage: Persistence - Expected [type] to be one of [pvc, vct, emptyDir, nfs, iscsi, hostPath, ixVolume, secret, configmap, device, projected], but got [not-a-type] + errorMessage: Persistence - Expected [type] to be one of [pvc, vct, emptyDir, nfs, iscsi, hostPath, secret, configmap, device, projected], but got [not-a-type] - it: should fail with invalid accessMode set: diff --git a/library/common-test/tests/pod/volume_ixVolume_test.yaml b/library/common-test/tests/pod/volume_ixVolume_test.yaml deleted file mode 100644 index 04298c26..00000000 --- a/library/common-test/tests/pod/volume_ixVolume_test.yaml +++ /dev/null @@ -1,179 +0,0 @@ -suite: pod ixVolume volume test -templates: - - common.yaml -release: - name: test-release-name - namespace: test-release-namespace -tests: - - it: should pass with ixVolume volume - set: - workload: - workload-name1: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: - - hostPath: /mnt/pool/ix-applications/ix-app - persistence: - ix-vol: - enabled: true - type: ixVolume - datasetName: ix-app - asserts: - - documentIndex: &deploymentDoc 0 - isKind: - of: Deployment - - documentIndex: *deploymentDoc - contains: - path: spec.template.spec.volumes - content: - name: ix-vol - hostPath: - path: /mnt/pool/ix-applications/ix-app - - - it: should pass with multiple ixVolume volumes - set: - workload: - workload-name1: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: - - hostPath: /mnt/pool/ix-applications/ix-app1 - - hostPath: /mnt/pool/ix-applications/ix-app2 - persistence: - ix-vol1: - enabled: true - type: ixVolume - datasetName: ix-app1 - ix-vol2: - enabled: true - type: ixVolume - datasetName: ix-app2 - asserts: - - documentIndex: &deploymentDoc 0 - isKind: - of: Deployment - - documentIndex: *deploymentDoc - contains: - path: spec.template.spec.volumes - content: - name: ix-vol1 - hostPath: - path: /mnt/pool/ix-applications/ix-app1 - - documentIndex: *deploymentDoc - contains: - path: spec.template.spec.volumes - content: - name: ix-vol2 - hostPath: - path: /mnt/pool/ix-applications/ix-app2 - - - it: should pass with ixVolume and hostPathType - set: - some_dataset: ix-app - some_type: DirectoryOrCreate - workload: - workload-name1: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: - - hostPath: /mnt/pool/ix-applications/ix-app - persistence: - ix-vol: - enabled: true - type: ixVolume - datasetName: "{{ .Values.some_dataset }}" - hostPathType: "{{ .Values.some_type }}" - asserts: - - documentIndex: *deploymentDoc - isKind: - of: Deployment - - documentIndex: *deploymentDoc - contains: - path: spec.template.spec.volumes - content: - name: ix-vol - hostPath: - path: /mnt/pool/ix-applications/ix-app - type: DirectoryOrCreate - -# Failures - - it: should fail without datasetName - set: - workload: - some-workload: - enabled: true - primary: true - type: Deployment - podSpec: {} - persistence: - volume1: - enabled: true - type: ixVolume - datasetname: "" - asserts: - - failedTemplate: - errorMessage: Persistence - Expected non-empty [datasetName] on [ixVolume] type - - - it: should fail with empty ixVolumes - set: - workload: - some-workload: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: [] - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - asserts: - - failedTemplate: - errorMessage: Persistence - Expected non-empty [ixVolumes] in values on [ixVolume] type - - - it: should fail with wrong ixVolumes - set: - workload: - some-workload: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: - - hostPath: /mnt/pool/ix-applications/ix-wrong-app - - hostPath: /mnt/pool/ix-applications/ix-other-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - asserts: - - failedTemplate: - errorMessage: Persistence - Expected [datasetName] [ix-app] to exist on [ixVolumes] list, but list contained [ix-wrong-app, ix-other-app] on [ixVolume] type - - - it: should fail with invalid hostPathType - set: - workload: - some-workload: - enabled: true - primary: true - type: Deployment - podSpec: {} - ixVolumes: - - hostPath: /mnt/pool/ix-applications/ix-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - hostPathType: invalid - asserts: - - failedTemplate: - errorMessage: Persistence - Expected [hostPathType] to be one of [DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice, BlockDevice], but got [invalid] diff --git a/library/common/templates/lib/pod/_volumes.tpl b/library/common/templates/lib/pod/_volumes.tpl index 4c868468..7f69ff09 100644 --- a/library/common/templates/lib/pod/_volumes.tpl +++ b/library/common/templates/lib/pod/_volumes.tpl @@ -53,8 +53,6 @@ objectData: The object data to be used to render the Pod. {{- if eq "pvc" $type -}} {{- include "tc.v1.common.lib.pod.volume.pvc" (dict "rootCtx" $rootCtx "objectData" $persistence) | trim | nindent 0 -}} - {{- else if eq "ixVolume" $type -}} - {{- include "tc.v1.common.lib.pod.volume.ixVolume" (dict "rootCtx" $rootCtx "objectData" $persistence) | trim | nindent 0 -}} {{- else if eq "hostPath" $type -}} {{- include "tc.v1.common.lib.pod.volume.hostPath" (dict "rootCtx" $rootCtx "objectData" $persistence) | trim | nindent 0 -}} {{- else if eq "secret" $type -}} diff --git a/library/common/templates/lib/pod/volumes/_ixVolume.tpl b/library/common/templates/lib/pod/volumes/_ixVolume.tpl deleted file mode 100644 index d29ada1d..00000000 --- a/library/common/templates/lib/pod/volumes/_ixVolume.tpl +++ /dev/null @@ -1,56 +0,0 @@ -{{/* Returns ixVolume Volume */}} -{{/* Call this template: -{{ include "tc.v1.common.lib.pod.volume.ixVolume" (dict "rootCtx" $ "objectData" $objectData) }} -rootCtx: The root context of the chart. -objectData: The object data to be used to render the volume. -*/}} -{{- define "tc.v1.common.lib.pod.volume.ixVolume" -}} - {{- $rootCtx := .rootCtx -}} - {{- $objectData := .objectData -}} - - {{- $hostPathType := "" -}} - {{- if $objectData.hostPathType -}} - {{- $hostPathType = tpl $objectData.hostPathType $rootCtx -}} - {{- end -}} - - {{- if not $objectData.datasetName -}} - {{- fail "Persistence - Expected non-empty [datasetName] on [ixVolume] type" -}} - {{- end -}} - {{- $datasetName := tpl $objectData.datasetName $rootCtx -}} - - {{- if not $rootCtx.Values.ixVolumes -}} - {{- fail "Persistence - Expected non-empty [ixVolumes] in values on [ixVolume] type" -}} - {{- end -}} - - {{- $hostPath := "" -}} - {{- $found := false -}} - {{- range $idx, $normalizedHostPath := $rootCtx.Values.ixVolumes -}} - {{- if eq $datasetName (base $normalizedHostPath.hostPath) -}} - {{- $found = true -}} - {{- $hostPath = $normalizedHostPath.hostPath -}} - {{- end -}} - {{- end -}} - - {{- if not $found -}} {{/* If we go over the ixVolumes and we dont find a match, fail */}} - {{- $datasets := list -}} - {{- range $rootCtx.Values.ixVolumes -}} - {{- $datasets = mustAppend $datasets (base .hostPath) -}} - {{- end -}} - {{- fail (printf "Persistence - Expected [datasetName] [%s] to exist on [ixVolumes] list, but list contained [%s] on [ixVolume] type" $datasetName (join ", " $datasets)) -}} - {{- end -}} - - {{- if not (hasPrefix "/" $hostPath) -}} - {{- fail "Persistence - Expected normalized path from [ixVolumes] to start with a forward slash [/] on [ixVolume] type" -}} - {{- end -}} - - {{- $types := (list "DirectoryOrCreate" "Directory" "FileOrCreate" "File" "Socket" "CharDevice" "BlockDevice") -}} - {{- if and $hostPathType (not (mustHas $hostPathType $types)) -}} - {{- fail (printf "Persistence - Expected [hostPathType] to be one of [%s], but got [%s]" (join ", " $types) $hostPathType) -}} - {{- end }} -- name: {{ $objectData.shortName }} - hostPath: - path: {{ $hostPath }} - {{- with $hostPathType }} - type: {{ $hostPathType }} - {{- end -}} -{{- end -}} diff --git a/library/common/templates/lib/storage/_validation.tpl b/library/common/templates/lib/storage/_validation.tpl index 0404da89..8c8276aa 100644 --- a/library/common/templates/lib/storage/_validation.tpl +++ b/library/common/templates/lib/storage/_validation.tpl @@ -10,7 +10,7 @@ objectData: {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} - {{- $types := (list "pvc" "vct" "emptyDir" "nfs" "iscsi" "hostPath" "ixVolume" "secret" "configmap" "device" "projected") -}} + {{- $types := (list "pvc" "vct" "emptyDir" "nfs" "iscsi" "hostPath" "secret" "configmap" "device" "projected") -}} {{- if not (mustHas $objectData.type $types) -}} {{- fail (printf "Persistence - Expected [type] to be one of [%s], but got [%s]" (join ", " $types) $objectData.type) -}} {{- end -}} diff --git a/library/common/templates/lib/util/_autoperms.tpl b/library/common/templates/lib/util/_autoperms.tpl index c77a7765..89b2b27a 100644 --- a/library/common/templates/lib/util/_autoperms.tpl +++ b/library/common/templates/lib/util/_autoperms.tpl @@ -1,7 +1,7 @@ {{/* Contains the auto-permissions job */}} {{- define "tc.v1.common.lib.util.autoperms" -}} -{{- $permAllowedTypes := (list "hostPath" "emptyDir" "nfs" "ixVolume") -}} +{{- $permAllowedTypes := (list "hostPath" "emptyDir" "nfs") -}} {{/* If you change this path, you must change it under _volumeMounts.tpl too*/}} {{- $basePath := "/mounts" -}} diff --git a/library/common/values.yaml b/library/common/values.yaml index 35cf570a..964ffbaf 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -354,12 +354,6 @@ ixExternalInterfacesConfiguration: [] # -- Injected from SCALE middleware # Only for reference here ixExternalInterfacesConfigurationNames: [] -# -- Injected from SCALE middleware -# Only for reference here -ixCertificates: [] -# -- Injected from SCALE middleware -# Only for reference here -ixVolumes: [] # -- (docs/imagePullSecrets.md) imagePullSecret: {}