(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestGetRegistryHandler(t *testing.T) { |
| 215 | type want struct { |
| 216 | podWithDatasetHandlerNames []string |
| 217 | nodeWithCacheArgs *nodeaffinitywithcache.TieredLocality |
| 218 | |
| 219 | podWithoutDatasetHandlerSize int |
| 220 | serverlessPodWithDatasetHandlerSize int |
| 221 | serverlessPodWithoutDatasetHandlerSize int |
| 222 | } |
| 223 | |
| 224 | tests := []struct { |
| 225 | name string |
| 226 | want want |
| 227 | newPluginErr bool |
| 228 | pluginProfile string |
| 229 | }{ |
| 230 | { |
| 231 | name: "existing correct configmap", |
| 232 | pluginProfile: ` |
| 233 | plugins: |
| 234 | serverful: |
| 235 | withDataset: |
| 236 | - RequireNodeWithFuse |
| 237 | - NodeAffinityWithCache |
| 238 | - MountPropagationInjector |
| 239 | withoutDataset: |
| 240 | - PreferNodesWithoutCache |
| 241 | serverless: |
| 242 | withDataset: |
| 243 | - FuseSidecar |
| 244 | withoutDataset: |
| 245 | - PreferNodesWithoutCache |
| 246 | pluginConfig: |
| 247 | - name: NodeAffinityWithCache |
| 248 | args: | |
| 249 | preferred: |
| 250 | # fluid existed node affinity, the name can not be modified. |
| 251 | - name: fluid.io/node |
| 252 | weight: 100 |
| 253 | # runtime worker's zone label name, can be changed according to k8s environment. |
| 254 | - name: topology.kubernetes.io/zone |
| 255 | weight: 50 |
| 256 | # runtime worker's region label name, can be changed according to k8s environment. |
| 257 | - name: topology.kubernetes.io/region |
| 258 | weight: 10 |
| 259 | required: |
| 260 | - fluid.io/node |
| 261 | `, |
| 262 | want: want{ |
| 263 | podWithDatasetHandlerNames: []string{ |
| 264 | "RequireNodeWithFuse", "NodeAffinityWithCache", "MountPropagationInjector", |
| 265 | }, |
| 266 | nodeWithCacheArgs: &nodeaffinitywithcache.TieredLocality{ |
| 267 | Preferred: []nodeaffinitywithcache.Preferred{ |
| 268 | { |
| 269 | Name: "fluid.io/node", |
| 270 | Weight: 100, |
| 271 | }, |
nothing calls this directly
no test coverage detected