add swift v2 config based on node label (#2144)
* add swift v2 config based on node label Signed-off-by: Evan Baker <rbtr@users.noreply.github.com> * add tentative swiftv2 label Signed-off-by: Evan Baker <rbtr@users.noreply.github.com> --------- Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
This commit is contained in:
Родитель
50422dcb75
Коммит
ba689eb932
|
@ -23,6 +23,7 @@ type CNSConfig struct {
|
|||
ChannelMode string
|
||||
EnablePprof bool
|
||||
EnableSubnetScarcity bool
|
||||
EnableSwiftV2 bool
|
||||
InitializeFromCNI bool
|
||||
ManagedSettings ManagedSettings
|
||||
MetricsBindAddress string
|
||||
|
|
|
@ -11,6 +11,8 @@ const (
|
|||
EnvNodeName = "NODENAME"
|
||||
// EnvNodeIP is the IP of the node running this CNS binary
|
||||
EnvNodeIP = "NODE_IP"
|
||||
// LabelSwiftV2 is the Node label for Swift V2
|
||||
LabelSwiftV2 = "kubernetes.azure.com/podnetwork-multi-tenancy"
|
||||
)
|
||||
|
||||
// ErrNodeNameUnset indicates the the $EnvNodeName variable is unset in the environment.
|
||||
|
|
|
@ -1235,6 +1235,12 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
|
|||
return errors.Wrapf(err, "failed to get node %s", nodeName)
|
||||
}
|
||||
|
||||
// check the Node labels for Swift V2
|
||||
if _, ok := node.Labels[configuration.LabelSwiftV2]; ok {
|
||||
cnsconfig.EnableSwiftV2 = true
|
||||
// TODO(rbtr): create the NodeInfo for Swift V2
|
||||
}
|
||||
|
||||
// get CNS Node IP to compare NC Node IP with this Node IP to ensure NCs were created for this node
|
||||
nodeIP := configuration.NodeIP()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче