Commit c5d2d2b
authored
[cinder-csi-plugin] Rationalise all things topology (#2865)
* cinder-csi-plugin: Don't set segment with empty topology value
This is actually handled by csi-provisioner, but it's arguably
incorrect.
Signed-off-by: Stephen Finucane <[email protected]>
* tests: Don't use global mocks
Calling '.On' with the same expected arguments multiple times will only
result in a single mock: the first one. We should avoid doing this.
We also remove some useless comments that simply duplicate what the
calls already say.
Signed-off-by: Stephen Finucane <[email protected]>
* cinder-csi-plugin: Add tests for ignore-volume-az
Signed-off-by: Stephen Finucane <[email protected]>
* cinder-csi-plugin: Add tests for --with-topology=false
This highlights an issue (IMO) is how we handle parameter generation.
Signed-off-by: Stephen Finucane <[email protected]>
* cinder-csi-plugin: Group topology generation
Group everything together rather than having it spread out as it is
currently. A decoder of the logic, to ensure nothing has changed:
1. Determine what the OpenStack Cinder volume's AZ will be:
a. If the `availability` parameter is set on the Storage Class, the
cinder volume will use this as the AZ.
b. Otherwise, the cinder volume will use: an AZ extracted from one of
the preferred CSI Topologies; an AZ extracted from one of the
requisite (available) Topologies; or no AZ.
2. Determine what the Kubernetes CSI Volume's topology will be:
a. If the `ignore-volume-az` option is set, the CSI Volume will use
the preferred CSI Volume Topologies, if any, else None. [*]
b. Otherwise, the CSI Volume will generate a Volume Topology from the
Cinder Volume's AZ.
[*] This practically means that `ignore-volume-az` is only useful when
the availability parameter is set on the Storage Class. This in turn
means the CSI Volume Topology is junk as it has no bearing on the
"real" topology constraint on the volume.
Signed-off-by: Stephen Finucane <[email protected]>
---------
Signed-off-by: Stephen Finucane <[email protected]>1 parent e2788e3 commit c5d2d2b
File tree
4 files changed
+297
-149
lines changed- pkg/csi/cinder
- openstack
4 files changed
+297
-149
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
89 | 96 | | |
90 | 97 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
104 | | - | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
| |||
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| |||
1035 | 1040 | | |
1036 | 1041 | | |
1037 | 1042 | | |
1038 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1039 | 1061 | | |
1040 | 1062 | | |
1041 | 1063 | | |
| |||
1075 | 1097 | | |
1076 | 1098 | | |
1077 | 1099 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | 1100 | | |
1094 | 1101 | | |
1095 | 1102 | | |
| |||
0 commit comments