fix cni issue (#1039)
This commit is contained in:
Родитель
f595b53ad3
Коммит
7fc87686a3
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче