Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cni/azure-linux-swift-overlay-dualstack.conflist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ipsToRouteViaHost":["169.254.20.10"],
"ipam":{
"type":"azure-cns",
"mode":"dualStackOverlay"
"mode":"overlay"
}
},
{
Expand Down
3 changes: 1 addition & 2 deletions cni/azure-linux-swift-overlay.conflist
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
{
"type":"azure-vnet",
"mode":"transparent",
"executionMode":"v4swift",
"ipsToRouteViaHost":["169.254.20.10"],
"ipam":{
"type":"azure-cns",
"mode":"v4overlay"
"mode":"overlay"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion cni/azure-windows-swift-overlay-dualstack.conflist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"ipam": {
"type": "azure-cns",
"mode": "dualStackOverlay"
"mode": "overlay"
},
"dns": {
"Nameservers": [
Expand Down
3 changes: 1 addition & 2 deletions cni/azure-windows-swift-overlay.conflist
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"type": "azure-vnet",
"mode": "bridge",
"bridge": "azure0",
"executionMode": "v4swift",
"capabilities": {
"portMappings": true,
"dns": true
},
"ipam": {
"type": "azure-cns",
"mode": "v4overlay"
"mode": "overlay"
},
"dns": {
"Nameservers": [
Expand Down
6 changes: 4 additions & 2 deletions cni/network/invoker_cns.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro

ncgw := net.ParseIP(info.ncGatewayIPAddress)
if ncgw == nil {
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) {
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) && (invoker.ipamMode != util.Overlay) {
return IPAMAddResult{}, errors.Wrap(errInvalidArgs, "%w: Gateway address "+info.ncGatewayIPAddress+" from response is invalid")
}

Expand Down Expand Up @@ -199,7 +200,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro

// set subnet prefix for host vm
// setHostOptions will execute if IPAM mode is not v4 overlay and not dualStackOverlay mode
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) {
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) && (invoker.ipamMode != util.Overlay) {
if err := setHostOptions(ncIPNet, addConfig.options, &info); err != nil {
return IPAMAddResult{}, err
}
Expand Down
3 changes: 2 additions & 1 deletion cni/network/invoker_cns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestCNSIPAMInvoker_Add_Overlay(t *testing.T) {
fields: fields{
podName: testPodInfo.PodName,
podNamespace: testPodInfo.PodNamespace,
ipamMode: util.V4Overlay,
ipamMode: util.Overlay,
cnsClient: &MockCNSClient{
unsupportedAPIs: unsupportedAPIs,
require: require,
Expand Down Expand Up @@ -148,6 +148,7 @@ func TestCNSIPAMInvoker_Add_Overlay(t *testing.T) {
fields: fields{
podName: testPodInfo.PodName,
podNamespace: testPodInfo.PodNamespace,
ipamMode: util.Overlay,
cnsClient: &MockCNSClient{
require: require,
requestIPs: requestIPsHandler{
Expand Down
3 changes: 2 additions & 1 deletion cni/network/network_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ func determineWinVer() {
}

func getNATInfo(nwCfg *cni.NetworkConfig, ncPrimaryIPIface interface{}, enableSnatForDNS bool) (natInfo []policy.NATInfo) {
if nwCfg.ExecutionMode == string(util.V4Swift) && nwCfg.IPAM.Mode != string(util.V4Overlay) && nwCfg.IPAM.Mode != string(util.DualStackOverlay) {
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
if nwCfg.ExecutionMode == string(util.V4Swift) && nwCfg.IPAM.Mode != string(util.V4Overlay) && nwCfg.IPAM.Mode != string(util.DualStackOverlay) && nwCfg.IPAM.Mode != string(util.Overlay) {
ncPrimaryIP := ""
if ncPrimaryIPIface != nil {
ncPrimaryIP = ncPrimaryIPIface.(string)
Expand Down
9 changes: 9 additions & 0 deletions cni/util/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ type IpamMode string
const (
V4Overlay IpamMode = "v4overlay"
DualStackOverlay IpamMode = "dualStackOverlay"
Overlay IpamMode = "overlay" // Nothing changes between 'v4overlay' and 'dualStackOverlay' mode, so consolidating to one
)

// Overlay consolidation plan
// First, we have v4overlay and dualstackoverlay conflists both have just 'overlay' in them
// Next, we release this CNI and conflist in AKS
// Next we will add a third 'overlay' conflist generator in CNS
// Release this CNS image
// Change AKS RP to use 'overlay' option for CNS configmap, for both v4overlay and dualstackoverlay
// Remove 'v4overlay' and 'dualstackoverlay' from ACN completely