allow FSGroupPolicy and PodInfoOnMount to be mutable in CSIDriver.Spec

This commit is contained in:
Hao Ruan
2023-03-02 16:27:50 +08:00
parent fc479f41b3
commit 531324cb1d
9 changed files with 355 additions and 102 deletions

View File

@@ -1715,6 +1715,17 @@ func TestCSIDriverValidationUpdate(t *testing.T) {
modify: func(new *storage.CSIDriver) {
new.Spec.SELinuxMount = &notSELinuxMount
},
}, {
name: "change PodInfoOnMount",
modify: func(new *storage.CSIDriver) {
new.Spec.PodInfoOnMount = &podInfoOnMount
},
}, {
name: "change FSGroupPolicy",
modify: func(new *storage.CSIDriver) {
fileFSGroupPolicy := storage.FileFSGroupPolicy
new.Spec.FSGroupPolicy = &fileFSGroupPolicy
},
}}
for _, test := range successCases {
t.Run(test.name, func(t *testing.T) {
@@ -1755,11 +1766,6 @@ func TestCSIDriverValidationUpdate(t *testing.T) {
modify: func(new *storage.CSIDriver) {
new.Spec.PodInfoOnMount = nil
},
}, {
name: "PodInfoOnMount changed",
modify: func(new *storage.CSIDriver) {
new.Spec.PodInfoOnMount = &podInfoOnMount
},
}, {
name: "invalid volume lifecycle mode",
modify: func(new *storage.CSIDriver) {
@@ -1792,12 +1798,6 @@ func TestCSIDriverValidationUpdate(t *testing.T) {
invalidFSGroupPolicy := storage.FSGroupPolicy("invalid")
new.Spec.FSGroupPolicy = &invalidFSGroupPolicy
},
}, {
name: "FSGroupPolicy changed",
modify: func(new *storage.CSIDriver) {
fileFSGroupPolicy := storage.FileFSGroupPolicy
new.Spec.FSGroupPolicy = &fileFSGroupPolicy
},
}, {
name: "TokenRequests invalidated",
modify: func(new *storage.CSIDriver) {