Skip to content

Commit ba689eb

Browse files
authored
add swift v2 config based on node label (#2144)
* add swift v2 config based on node label Signed-off-by: Evan Baker <[email protected]> * add tentative swiftv2 label Signed-off-by: Evan Baker <[email protected]> --------- Signed-off-by: Evan Baker <[email protected]>
1 parent 50422dc commit ba689eb

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

cns/configuration/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type CNSConfig struct {
2323
ChannelMode string
2424
EnablePprof bool
2525
EnableSubnetScarcity bool
26+
EnableSwiftV2 bool
2627
InitializeFromCNI bool
2728
ManagedSettings ManagedSettings
2829
MetricsBindAddress string

cns/configuration/env.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const (
1111
EnvNodeName = "NODENAME"
1212
// EnvNodeIP is the IP of the node running this CNS binary
1313
EnvNodeIP = "NODE_IP"
14+
// LabelSwiftV2 is the Node label for Swift V2
15+
LabelSwiftV2 = "kubernetes.azure.com/podnetwork-multi-tenancy"
1416
)
1517

1618
// ErrNodeNameUnset indicates the the $EnvNodeName variable is unset in the environment.

cns/service/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,12 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
12351235
return errors.Wrapf(err, "failed to get node %s", nodeName)
12361236
}
12371237

1238+
// check the Node labels for Swift V2
1239+
if _, ok := node.Labels[configuration.LabelSwiftV2]; ok {
1240+
cnsconfig.EnableSwiftV2 = true
1241+
// TODO(rbtr): create the NodeInfo for Swift V2
1242+
}
1243+
12381244
// get CNS Node IP to compare NC Node IP with this Node IP to ensure NCs were created for this node
12391245
nodeIP := configuration.NodeIP()
12401246

0 commit comments

Comments
 (0)