From 303f43080c8fcf90194e087af7e1f44b33361d19 Mon Sep 17 00:00:00 2001 From: Serge Logvinov Date: Thu, 4 May 2023 12:37:58 +0300 Subject: [PATCH] refactor: rename storageID to storage BREAKING CHANGE: Rename in StorageClass key storageID -> storage --- Dockerfile | 2 +- README.md | 8 ++++---- charts/proxmox-csi-plugin/Chart.yaml | 6 +++--- charts/proxmox-csi-plugin/README.md | 6 +++--- charts/proxmox-csi-plugin/README.md.gotmpl | 4 ++-- charts/proxmox-csi-plugin/ci/values.yaml | 4 ++-- .../templates/storageclass.yaml | 2 +- charts/proxmox-csi-plugin/values.edge.yaml | 4 ++-- charts/proxmox-csi-plugin/values.talos.yaml | 4 ++-- charts/proxmox-csi-plugin/values.yaml | 2 +- docs/deploy/proxmox-csi-plugin-talos.yml | 18 +++++++++--------- docs/deploy/proxmox-csi-plugin.yml | 18 +++++++++--------- pkg/csi/controller_test.go | 4 ++-- pkg/csi/driver.go | 2 +- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b89619..184b464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN go mod download ######################################## -FROM --platform=${BUILDPLATFORM} golang:1.20.3-alpine3.17 AS builder +FROM --platform=${BUILDPLATFORM} golang:1.20.4-alpine3.17 AS builder RUN apk update && apk add --no-cache make ENV GO111MODULE on WORKDIR /src diff --git a/README.md b/README.md index 5838baf..7cf0908 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Source: ReadOnly: false VolumeAttributes: cache=writethrough storage.kubernetes.io/csiProvisionerIdentity=1682607985217-8081-csi.proxmox.sinextra.dev - storageID=data + storage=data ``` ### Statefulset with persistent storage @@ -195,7 +195,7 @@ Source: ReadOnly: false VolumeAttributes: cache=writethrough storage.kubernetes.io/csiProvisionerIdentity=1682607985217-8081-csi.proxmox.sinextra.dev - storageID=data + storage=data ``` ### Usage @@ -247,7 +247,7 @@ metadata: name: proxmox-data-xfs parameters: csi.storage.k8s.io/fstype: xfs|ext4 - storageID: data + storage: data cache: directsync|none|writeback|writethrough ssd: "true|false" provisioner: csi.proxmox.sinextra.dev @@ -257,7 +257,7 @@ volumeBindingMode: WaitForFirstConsumer ``` Storage parameters: -* storageID - proxmox storage ID +* storage - proxmox storage ID * cache - qemu cache param: `directsync`, `none`, `writeback`, `writethrough` see [official documentation](https://pve.proxmox.com/wiki/Performance_Tweaks) * ssd - true if SSD/NVME disk diff --git a/charts/proxmox-csi-plugin/Chart.yaml b/charts/proxmox-csi-plugin/Chart.yaml index 803e291..668f56b 100644 --- a/charts/proxmox-csi-plugin/Chart.yaml +++ b/charts/proxmox-csi-plugin/Chart.yaml @@ -11,13 +11,13 @@ keywords: - block-storage - volume maintainers: - - name: sergelogvinov - url: https://github.com/sergelogvinov +- name: sergelogvinov + url: https://github.com/sergelogvinov # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.3 +version: 0.0.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/proxmox-csi-plugin/README.md b/charts/proxmox-csi-plugin/README.md index d2b795d..e024da1 100644 --- a/charts/proxmox-csi-plugin/README.md +++ b/charts/proxmox-csi-plugin/README.md @@ -1,6 +1,6 @@ # proxmox-csi-plugin -![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.2](https://img.shields.io/badge/AppVersion-v0.0.2-informational?style=flat-square) +![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.2](https://img.shields.io/badge/AppVersion-v0.0.2-informational?style=flat-square) A CSI plugin for Proxmox @@ -48,11 +48,11 @@ tolerations: # See https://pve.proxmox.com/wiki/Storage storageClass: - name: proxmox-data-xfs - storageID: data + storage: data reclaimPolicy: Delete fstype: xfs - name: proxmox-data - storageID: data + storage: data reclaimPolicy: Delete fstype: ext4 cache: writethrough diff --git a/charts/proxmox-csi-plugin/README.md.gotmpl b/charts/proxmox-csi-plugin/README.md.gotmpl index 5709e0b..da7ee0c 100644 --- a/charts/proxmox-csi-plugin/README.md.gotmpl +++ b/charts/proxmox-csi-plugin/README.md.gotmpl @@ -46,11 +46,11 @@ tolerations: # See https://pve.proxmox.com/wiki/Storage storageClass: - name: proxmox-data-xfs - storageID: data + storage: data reclaimPolicy: Delete fstype: xfs - name: proxmox-data - storageID: data + storage: data reclaimPolicy: Delete fstype: ext4 cache: writethrough diff --git a/charts/proxmox-csi-plugin/ci/values.yaml b/charts/proxmox-csi-plugin/ci/values.yaml index 54b440e..7c83414 100644 --- a/charts/proxmox-csi-plugin/ci/values.yaml +++ b/charts/proxmox-csi-plugin/ci/values.yaml @@ -13,10 +13,10 @@ tolerations: storageClass: - name: proxmox-data-xfs - storageID: data + storage: data reclaimPolicy: Delete fstype: xfs - name: proxmox-data - storageID: data + storage: data reclaimPolicy: Delete ssd: true diff --git a/charts/proxmox-csi-plugin/templates/storageclass.yaml b/charts/proxmox-csi-plugin/templates/storageclass.yaml index 7eab477..2049f62 100644 --- a/charts/proxmox-csi-plugin/templates/storageclass.yaml +++ b/charts/proxmox-csi-plugin/templates/storageclass.yaml @@ -8,8 +8,8 @@ allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer reclaimPolicy: {{ default "Delete" $storage.reclaimPolicy }} parameters: - storageID: {{ $storage.storageID }} csi.storage.k8s.io/fstype: {{ default "ext4" $storage.fstype }} + storage: {{ $storage.storage }} {{- if $storage.cache }} cache: {{ $storage.cache }} {{- end }} diff --git a/charts/proxmox-csi-plugin/values.edge.yaml b/charts/proxmox-csi-plugin/values.edge.yaml index dcb349d..1b3c37b 100644 --- a/charts/proxmox-csi-plugin/values.edge.yaml +++ b/charts/proxmox-csi-plugin/values.edge.yaml @@ -22,9 +22,9 @@ tolerations: storageClass: - name: proxmox-data-xfs - storageID: data + storage: data reclaimPolicy: Delete fstype: xfs - name: proxmox-data - storageID: data + storage: data ssd: true diff --git a/charts/proxmox-csi-plugin/values.talos.yaml b/charts/proxmox-csi-plugin/values.talos.yaml index 14f67c4..7622419 100644 --- a/charts/proxmox-csi-plugin/values.talos.yaml +++ b/charts/proxmox-csi-plugin/values.talos.yaml @@ -13,9 +13,9 @@ tolerations: storageClass: - name: proxmox-data-xfs - storageID: data + storage: data reclaimPolicy: Delete fstype: xfs - name: proxmox-data - storageID: data + storage: data reclaimPolicy: Delete diff --git a/charts/proxmox-csi-plugin/values.yaml b/charts/proxmox-csi-plugin/values.yaml index e3a26fa..e93e07e 100644 --- a/charts/proxmox-csi-plugin/values.yaml +++ b/charts/proxmox-csi-plugin/values.yaml @@ -57,7 +57,7 @@ config: # -- Storage class defenition. storageClass: [] # - name: proxmox-data-xfs - # storageID: data + # storage: data # reclaimPolicy: Delete # fstype: ext4|xfs # diff --git a/docs/deploy/proxmox-csi-plugin-talos.yml b/docs/deploy/proxmox-csi-plugin-talos.yml index 2d30fc2..b44e08e 100644 --- a/docs/deploy/proxmox-csi-plugin-talos.yml +++ b/docs/deploy/proxmox-csi-plugin-talos.yml @@ -16,7 +16,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -29,7 +29,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -45,8 +45,8 @@ allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete parameters: - storageID: data csi.storage.k8s.io/fstype: xfs + storage: data --- # Source: proxmox-csi-plugin/templates/storageclass.yaml apiVersion: storage.k8s.io/v1 @@ -58,8 +58,8 @@ allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete parameters: - storageID: data csi.storage.k8s.io/fstype: ext4 + storage: data --- # Source: proxmox-csi-plugin/templates/controller-clusterrole.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -68,7 +68,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -111,7 +111,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -159,7 +159,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -201,7 +201,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -330,7 +330,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" diff --git a/docs/deploy/proxmox-csi-plugin.yml b/docs/deploy/proxmox-csi-plugin.yml index 224eb6b..7d20735 100644 --- a/docs/deploy/proxmox-csi-plugin.yml +++ b/docs/deploy/proxmox-csi-plugin.yml @@ -16,7 +16,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -29,7 +29,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -45,8 +45,8 @@ allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete parameters: - storageID: data csi.storage.k8s.io/fstype: xfs + storage: data --- # Source: proxmox-csi-plugin/templates/storageclass.yaml apiVersion: storage.k8s.io/v1 @@ -58,8 +58,8 @@ allowVolumeExpansion: true volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete parameters: - storageID: data csi.storage.k8s.io/fstype: ext4 + storage: data ssd: "true" --- # Source: proxmox-csi-plugin/templates/controller-clusterrole.yaml @@ -69,7 +69,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -112,7 +112,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -160,7 +160,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -202,7 +202,7 @@ metadata: name: proxmox-csi-plugin-node namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" @@ -336,7 +336,7 @@ metadata: name: proxmox-csi-plugin-controller namespace: csi-proxmox labels: - helm.sh/chart: proxmox-csi-plugin-0.0.3 + helm.sh/chart: proxmox-csi-plugin-0.0.4 app.kubernetes.io/name: proxmox-csi-plugin app.kubernetes.io/instance: proxmox-csi-plugin app.kubernetes.io/version: "v0.0.2" diff --git a/pkg/csi/controller_test.go b/pkg/csi/controller_test.go index 67fe5b0..84db74a 100644 --- a/pkg/csi/controller_test.go +++ b/pkg/csi/controller_test.go @@ -243,7 +243,7 @@ func (ts *csiTestSuite) TestCreateVolume() { }, } volParam := map[string]string{ - "storageID": "local-lvm", + "storage": "local-lvm", } volsize := &proto.CapacityRange{ RequiredBytes: 1, @@ -306,7 +306,7 @@ func (ts *csiTestSuite) TestCreateVolume() { CapacityRange: volsize, AccessibilityRequirements: topology, }, - expectedError: status.Error(codes.InvalidArgument, "Parameters storageID must be provided"), + expectedError: status.Error(codes.InvalidArgument, "Parameters storage must be provided"), }, { msg: "RegionZone", diff --git a/pkg/csi/driver.go b/pkg/csi/driver.go index 25da721..39ce896 100644 --- a/pkg/csi/driver.go +++ b/pkg/csi/driver.go @@ -24,7 +24,7 @@ const ( DriverVersion = "0.0.1" // StorageIDKey is the ID of the Proxmox storage - StorageIDKey = "storageID" + StorageIDKey = "storage" // StorageCacheKey is the cache type, can be one of "directsync", "none", "writeback", "writethrough" StorageCacheKey = "cache" // StorageSSDKey is it ssd disk