Delete container even if NetNs is not specified (#357)
This commit is contained in:
Родитель
1ef64428fc
Коммит
4df8d64a34
|
@ -619,7 +619,7 @@ func (plugin *netPlugin) Delete(args *cniSkel.CmdArgs) error {
|
|||
// Parse Pod arguments.
|
||||
k8sPodName, k8sNamespace, err := plugin.getPodInfo(args.Args)
|
||||
if err != nil {
|
||||
return err
|
||||
log.Printf("[cni-net] Failed to get POD info due to error: %v", err)
|
||||
}
|
||||
|
||||
// Initialize values from network config.
|
||||
|
|
|
@ -116,6 +116,11 @@ func getNetworkName(podName, podNs, ifName string, nwCfg *cni.NetworkConfig) (ne
|
|||
networkName = nwCfg.Name
|
||||
err = nil
|
||||
if nwCfg.MultiTenancy {
|
||||
if len(strings.TrimSpace(podName)) == 0 || len(strings.TrimSpace(podNs)) == 0 {
|
||||
err = fmt.Errorf("POD info cannot be empty. PodName: %s, PodNamespace: %s", podName, podNs)
|
||||
return
|
||||
}
|
||||
|
||||
_, cnsNetworkConfig, _, err := getContainerNetworkConfiguration(nwCfg, podName, podNs, ifName)
|
||||
if err != nil {
|
||||
log.Printf("GetContainerNetworkConfiguration failed for podname %v namespace %v with error %v", podName, podNs, err)
|
||||
|
|
Загрузка…
Ссылка в новой задаче