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
3 changes: 2 additions & 1 deletion cni/network/multitenancy.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ func (m *Multitenancy) DetermineSnatFeatureOnHost(snatFile, nmAgentSupportedApis
// If we weren't able to retrieve snatConfiguration, query NMAgent
if retrieveSnatConfigErr != nil {
var resp *http.Response
req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, nmAgentSnatAndDnsSupportAPI, nil)
req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, nmAgentSupportedApisURL, nil)
if err != nil {
log.Errorf("failed creating http request:%+v", err)
return false, false, fmt.Errorf("%w", err)
}
log.Printf("Query nma for dns snat support: %s", nmAgentSupportedApisURL)
resp, retrieveSnatConfigErr = httpClient.Do(req)
if retrieveSnatConfigErr == nil {
defer resp.Body.Close()
Expand Down
8 changes: 5 additions & 3 deletions cni/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
plugin.report.Context = "AzureCNIMultitenancy"
// Temporary if block to determining whether we disable SNAT on host (for multi-tenant scenario only)
if enableSnatForDns, nwCfg.EnableSnatOnHost, err = plugin.multitenancyClient.DetermineSnatFeatureOnHost(
snatConfigFileName, nmAgentSnatAndDnsSupportAPI); err != nil {
snatConfigFileName, nmAgentSupportedApisURL); err != nil {
return fmt.Errorf("%w", err)
}

Expand Down Expand Up @@ -473,13 +473,15 @@ func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error {
nwInfo.IPAMType = nwCfg.Ipam.Type
options = nwInfo.Options

result, err = plugin.handleConsecutiveAdd(args, endpointId, networkID, &nwInfo, nwCfg)
var resultSecondAdd *cniTypesCurr.Result
resultSecondAdd, err = plugin.handleConsecutiveAdd(args, endpointId, networkID, &nwInfo, nwCfg)
if err != nil {
log.Printf("handleConsecutiveAdd failed with error %v", err)
return err
}

if result != nil {
if resultSecondAdd != nil {
result = resultSecondAdd
return nil
}
}
Expand Down