From 2cb1cdc182925c18bd608ab95319f532a8fcd3a9 Mon Sep 17 00:00:00 2001 From: estevan <50840058+chaireze@users.noreply.github.com> Date: Wed, 9 Aug 2023 18:00:39 -0400 Subject: [PATCH 1/3] pvc_annotator: update volume state anno to reflect what happens in hydra --- pkg/edgecache/cachevolume/pvc_annotator.go | 8 ++++---- pkg/edgecache/cachevolume/pvc_annotator_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/edgecache/cachevolume/pvc_annotator.go b/pkg/edgecache/cachevolume/pvc_annotator.go index d02076891..4ff85f91c 100644 --- a/pkg/edgecache/cachevolume/pvc_annotator.go +++ b/pkg/edgecache/cachevolume/pvc_annotator.go @@ -33,7 +33,7 @@ import ( const ( accountAnnotation string = "external/edgecache-account" containerAnnotation string = "external/edgecache-container" - createVolumeAnnotation string = "external/edgecache-create-volume" + volumeStateAnnotation string = "external/edgecache-volume-state" secretNameAnnotation string = "external/edgecache-secret-name" secretNamespaceAnnotation string = "external/edgecache-secret-namespace" storageAuthenticationAnnotation string = "external/edgecache-authentication" @@ -84,7 +84,7 @@ func (c *PVCAnnotator) requestAuthIsValid(auth string) bool { func (c *PVCAnnotator) buildAnnotations(pv *v1.PersistentVolume, cfg config.AzureAuthConfig, providedAuth BlobAuth) (map[string]string, error) { annotations := map[string]string{ - createVolumeAnnotation: "yes", + volumeStateAnnotation: "not created", accountAnnotation: providedAuth.account, containerAnnotation: providedAuth.container, storageAuthenticationAnnotation: providedAuth.authType, @@ -126,8 +126,8 @@ func (c *PVCAnnotator) buildAnnotations(pv *v1.PersistentVolume, cfg config.Azur func (c *PVCAnnotator) needsToBeProvisioned(pvc *v1.PersistentVolumeClaim) bool { // check if pv connected to the pvc has already been passed to be created - pvState, pvStateOk := pvc.ObjectMeta.Annotations[createVolumeAnnotation] - if pvStateOk && pvState == "no" { + pvState, pvStateOk := pvc.ObjectMeta.Annotations[volumeStateAnnotation] + if pvStateOk && pvState == "created" { return false } diff --git a/pkg/edgecache/cachevolume/pvc_annotator_test.go b/pkg/edgecache/cachevolume/pvc_annotator_test.go index 8d72fe7e7..3f8c62e61 100644 --- a/pkg/edgecache/cachevolume/pvc_annotator_test.go +++ b/pkg/edgecache/cachevolume/pvc_annotator_test.go @@ -102,7 +102,7 @@ func TestSendProvisionVolumeFailures(t *testing.T) { }, { name: "VolumeIsAlreadyBeingProvisioned", - annotations: map[string]string{createVolumeAnnotation: "no"}, + annotations: map[string]string{volumeStateAnnotation: "no"}, config: config.AzureAuthConfig{}, blobAuth: NewBlobAuth("", "", "", "", "WorkloadIdentity"), }, @@ -154,7 +154,7 @@ func TestSendProvisionVolumeSuccess(t *testing.T) { config: config.AzureAuthConfig{UseFederatedWorkloadIdentityExtension: true}, blobAuth: NewBlobAuth(acct, container, "", "", "WorkloadIdentity"), expectedAnnotations: map[string]string{ - createVolumeAnnotation: "yes", + volumeStateAnnotation: "not created", accountAnnotation: acct, containerAnnotation: container, storageAuthenticationAnnotation: "WorkloadIdentity", @@ -166,7 +166,7 @@ func TestSendProvisionVolumeSuccess(t *testing.T) { config: config.AzureAuthConfig{}, blobAuth: NewBlobAuth(acct, container, secret, secretNamespace, "AccountKey"), expectedAnnotations: map[string]string{ - createVolumeAnnotation: "yes", + volumeStateAnnotation: "not created", accountAnnotation: acct, containerAnnotation: container, secretNamespaceAnnotation: secretNamespace, @@ -180,7 +180,7 @@ func TestSendProvisionVolumeSuccess(t *testing.T) { config: config.AzureAuthConfig{}, blobAuth: NewBlobAuth(acct, container, "", "", "AccountKey"), expectedAnnotations: map[string]string{ - createVolumeAnnotation: "yes", + volumeStateAnnotation: "not created", accountAnnotation: acct, containerAnnotation: container, secretNamespaceAnnotation: secretNamespace, From 6887eb54767197cdd1533a685ee74b28828c89b2 Mon Sep 17 00:00:00 2001 From: estevan <50840058+chaireze@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:51:05 -0400 Subject: [PATCH 2/3] charts: add new chart since changes are not backwards compatible --- charts/index.yaml | 9 + charts/v4.2.0/blob-csi-driver-v4.2.0.tgz | Bin 0 -> 5821 bytes charts/v4.2.0/blob-csi-driver/Chart.yaml | 5 + .../blob-csi-driver/templates/NOTES.txt | 5 + .../blob-csi-driver/templates/_helpers.tpl | 49 +++ .../templates/csi-blob-controller.yaml | 216 +++++++++++++ .../templates/csi-blob-driver.yaml | 14 + .../templates/csi-blob-node.yaml | 288 ++++++++++++++++++ .../templates/rbac-csi-blob-controller.yaml | 115 +++++++ .../templates/rbac-csi-blob-node.yaml | 38 +++ .../serviceaccount-csi-blob-controller.yaml | 17 ++ .../serviceaccount-csi-blob-node.yaml | 17 ++ charts/v4.2.0/blob-csi-driver/values.yaml | 173 +++++++++++ 13 files changed, 946 insertions(+) create mode 100644 charts/v4.2.0/blob-csi-driver-v4.2.0.tgz create mode 100644 charts/v4.2.0/blob-csi-driver/Chart.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/NOTES.txt create mode 100644 charts/v4.2.0/blob-csi-driver/templates/_helpers.tpl create mode 100644 charts/v4.2.0/blob-csi-driver/templates/csi-blob-controller.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/csi-blob-driver.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/csi-blob-node.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/rbac-csi-blob-controller.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/rbac-csi-blob-node.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/serviceaccount-csi-blob-controller.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/templates/serviceaccount-csi-blob-node.yaml create mode 100644 charts/v4.2.0/blob-csi-driver/values.yaml diff --git a/charts/index.yaml b/charts/index.yaml index 3cf133be2..0729482ac 100644 --- a/charts/index.yaml +++ b/charts/index.yaml @@ -244,6 +244,15 @@ entries: urls: - https://raw.githubusercontent.com/avoltz/blob-csi-driver/staging/charts/v4.1.0/blob-csi-driver-v4.1.0.tgz version: v4.1.0 + - apiVersion: v1 + appVersion: v4.2.0 + created: "2023-08-10T09:50:00.254303884Z" + description: Azure Blob Storage CSI driver + digest: 7e8895c9b539bd3866b18a0aada619582b36c5e4b06ef454f22194d24e69d4f9 + name: blob-csi-driver + urls: + - https://raw.githubusercontent.com/avoltz/blob-csi-driver/staging/charts/v4.2.0/blob-csi-driver-v4.2.0.tgz + version: v4.2.0 - apiVersion: v1 appVersion: latest created: "2023-06-05T13:16:16.079514405Z" diff --git a/charts/v4.2.0/blob-csi-driver-v4.2.0.tgz b/charts/v4.2.0/blob-csi-driver-v4.2.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..167fdd63dc3090c4dc02f70e5e225c87c0fe121b GIT binary patch literal 5821 zcmV;u7DDMCiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<&bK5r3{j6VsQF_zfJ)z$GlAdP#!LgK76GzrqPI~urIv$8z zNjQ@L3xJAM*Z=()0DOOuWLZ{neZ+i-MJ{$1;O=6vy8tIHn^?9Wmcz*cc=KY8xoj-4 z=YF@dtJP|?PLGfE|E*Rl|9`7}dh}iU`1tgseR^`#e)C2ZYUuFZI3iKLQTut;;58EE&f$Ko{cy zGQv}%*n=+0iBxS7<3Db68m-#b?(*SEU3vXqU^f75$102LV()v;`S)wjjzr052iHglOIc6W|mi2t`8Cv;3q{ zLUM7`IBB%jk#xxdC`P`xoMCh)m~4kX1gqK!dYSzOk84Ls5`aVt5@h6roe&PfFwhV z0%9C_i~|y2bC5#ao&X92IOxk9s3t?`3~3P+3I&I07tN*gMYow^xYl3ZJEsSw1HVEFl`wWwWO5j{?^n8*aMj*WYTdkcG^g<}JgQ zxBLK012V)O)M^6wg4l3w+bp0`jjzoCOXwoW13<6PFRCl*@7E}VMc4of^o6*t>a%I$ zpef^M$$|zNgH*#Y#jXHErs^j8f~me42vEN{Vqa)O(PLC{=DNVU>P=fl7vr0jz~~iH z%px{LepOk-qO=pqo3dAW9kN`^d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LLwSX{xM(e7fB>KqRsN;9Aw6H#P*ZM-_+#(LBnOPR~YP0itpSP#uNj~~^yEzVf zDh_)p3aF}Pp^ebqYV8x%*ehnr^~kd`-C;|}M*MBFB_!(sY_1Gb0Nfe>+BR%ehRjwo_N?tDD{ShJU1638l@QX=zPDQrmC&3MT&n zTZUR|x-!m`cGnVD=_x0_Zn7msS(`9+R5W?dv0sr`tQhyIm-nKkHaueCzroCIU?O&G zWuHZ%X+Ce1C$wcR%I)g&4C>yklalX!+os(J_+P*%YN>DbD>4%5Ic@ibprtAObYyw~R{kK-Doj?EK z`1tVsx4m3z*8h8*2y~6?w=@O(R@3)hnNQv^2apM6BQFqAf6{fC-T{mx(~zUj7y3I{ zaj9LDGYPQ~iDn>01p9;fi?d)h5AXaSUcjS%39mU0MSPX{F)c3N%FLMFe7u)Au|#JM zv*F>|_^O`&L&?TQvY(R)STp~(Tc; Date: Thu, 10 Aug 2023 13:11:57 -0400 Subject: [PATCH 3/3] pvc_annotator: ignore applying hints if 'created' OR 'creating' --- pkg/edgecache/cachevolume/pvc_annotator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/edgecache/cachevolume/pvc_annotator.go b/pkg/edgecache/cachevolume/pvc_annotator.go index 4ff85f91c..919a53e95 100644 --- a/pkg/edgecache/cachevolume/pvc_annotator.go +++ b/pkg/edgecache/cachevolume/pvc_annotator.go @@ -127,7 +127,7 @@ func (c *PVCAnnotator) buildAnnotations(pv *v1.PersistentVolume, cfg config.Azur func (c *PVCAnnotator) needsToBeProvisioned(pvc *v1.PersistentVolumeClaim) bool { // check if pv connected to the pvc has already been passed to be created pvState, pvStateOk := pvc.ObjectMeta.Annotations[volumeStateAnnotation] - if pvStateOk && pvState == "created" { + if pvStateOk && (pvState == "created" || pvState == "creating") { return false }