@@ -115,24 +115,23 @@ func SupportsTopology(pluginCapabilities rpc.PluginCapabilitySet) bool {
115115//
116116// 1) selectedNode is not set (immediate binding):
117117//
118- // In this case, we list all CSINode objects to find a Node that
119- // the driver has registered topology keys with.
118+ // In this case, we list all CSINode objects to find a Node that
119+ // the driver has registered topology keys with.
120120//
121- // Once we get the list of CSINode objects, we find one that has
122- // topology keys registered. If none are found, then we assume
123- // that the driver has not started on any node yet, and we error
124- // and retry.
121+ // Once we get the list of CSINode objects, we find one that has
122+ // topology keys registered. If none are found, then we assume
123+ // that the driver has not started on any node yet, and we error
124+ // and retry.
125125//
126- // If at least one CSINode object is found with topology keys,
127- // then we continue and use that for assembling the topology
128- // requirement. The available topologies will be limited to the
129- // Nodes that the driver has registered with.
126+ // If at least one CSINode object is found with topology keys,
127+ // then we continue and use that for assembling the topology
128+ // requirement. The available topologies will be limited to the
129+ // Nodes that the driver has registered with.
130130//
131131// 2) selectedNode is set (delayed binding):
132132//
133- // We will get the topology from the CSINode object for the selectedNode
134- // and error if we can't (and retry).
135- //
133+ // We will get the topology from the CSINode object for the selectedNode
134+ // and error if we can't (and retry).
136135func GenerateAccessibilityRequirements (
137136 kubeClient kubernetes.Interface ,
138137 driverName string ,
@@ -380,21 +379,28 @@ func aggregateTopologies(
380379// This function eliminates the OR of topology values by distributing the OR over the AND a level
381380// higher.
382381// For example, given a TopologySelectorTerm of this form:
383- // {
384- // "zone": { "zone1", "zone2" },
385- // "rack": { "rackA", "rackB" },
386- // }
382+ //
383+ // {
384+ // "zone": { "zone1", "zone2" },
385+ // "rack": { "rackA", "rackB" },
386+ // }
387+ //
387388// Abstractly it could be viewed as:
388- // (zone1 OR zone2) AND (rackA OR rackB)
389+ //
390+ // (zone1 OR zone2) AND (rackA OR rackB)
391+ //
389392// Distributing the OR over the AND, we get:
390- // (zone1 AND rackA) OR (zone2 AND rackA) OR (zone1 AND rackB) OR (zone2 AND rackB)
393+ //
394+ // (zone1 AND rackA) OR (zone2 AND rackA) OR (zone1 AND rackB) OR (zone2 AND rackB)
395+ //
391396// which in the intermediate representation returned by this function becomes:
392- // [
393- // { "zone": "zone1", "rack": "rackA" },
394- // { "zone": "zone2", "rack": "rackA" },
395- // { "zone": "zone1", "rack": "rackB" },
396- // { "zone": "zone2", "rack": "rackB" },
397- // ]
397+ //
398+ // [
399+ // { "zone": "zone1", "rack": "rackA" },
400+ // { "zone": "zone2", "rack": "rackA" },
401+ // { "zone": "zone1", "rack": "rackB" },
402+ // { "zone": "zone2", "rack": "rackB" },
403+ // ]
398404//
399405// This flattening is then applied to all TopologySelectorTerms in AllowedTopologies, and
400406// the resulting terms are OR'd together.
@@ -524,7 +530,7 @@ func (t topologyTerm) clone() topologyTerm {
524530// - com.example.csi/rack#zz < com.example.csi/zone#zone1
525531// - com.example.csi/z#z1 < com.example.csi/zone#zone1
526532// - com.example.csi/rack#rackA,com.example.csi/zone#zone2 < com.example.csi/rackB,com.example.csi/zone#zone1
527- // Note that both '#' and ',' are less than '/', '-', '_', '.', [A-Z0-9a-z]
533+ // Note that both '#' and ',' are less than '/', '-', '_', '.', [A-Z0-9a-z]
528534func (t topologyTerm ) hash () string {
529535 var segments []string
530536 for k , v := range t {
0 commit comments