Skip to content

Commit eaaad3b

Browse files
committed
correct the fmt errors on the controller files.
Reference #kubernetes-csi/csi-release-tools#203 Signed-off-by: Humble Chirammal <[email protected]>
1 parent 9aa9392 commit eaaad3b

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

pkg/controller/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,9 @@ func verifyAndGetSecretNameAndNamespaceTemplate(secret secretParamsMap, storageC
16681668
}
16691669

16701670
// getSecretReference returns a reference to the secret specified in the given nameTemplate
1671-
// and namespaceTemplate, or an error if the templates are not specified correctly.
1671+
//
1672+
// and namespaceTemplate, or an error if the templates are not specified correctly.
1673+
//
16721674
// no lookup of the referenced secret is performed, and the secret may or may not exist.
16731675
//
16741676
// supported tokens for name resolution:

pkg/controller/topology.go

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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).
136135
func 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]
528534
func (t topologyTerm) hash() string {
529535
var segments []string
530536
for k, v := range t {

0 commit comments

Comments
 (0)