-
Notifications
You must be signed in to change notification settings - Fork 260
Description
What happened:
If the HNS endpoints in the CNI state file are inconsistent with the existing HNS endpoints, a CNI delete will error, bubbling up an endpoint not found error from HNS delete.
2020/10/28 04:46:26 [15764] Get number of endpoints for ifname vEthernet (Ethernet 2) network azure
2020/10/28 04:46:26 [15764] Trying to retrieve endpoint id dee435e2-eth0
2020/10/28 04:46:26 [15764] [net] Deleting endpoint dee435e2-eth0 from network azure.
2020/10/28 04:46:26 [15764] Trying to retrieve endpoint id dee435e2-eth0
2020/10/28 04:46:26 [15764] [net] HNSEndpointRequest DELETE id:69166148-C6C5-4791-AA43-62DBAB38AB49
2020/10/28 04:46:26 [15764] [net] HNSEndpointRequest DELETE response:<nil> err:hns failed with error : The endpoint was not found. .
2020/10/28 04:46:26 [15764] [net] Failed to delete endpoint dee435e2-eth0, err:hns failed with error : The endpoint was not found. .
2020/10/28 04:46:26 [15764] [azure-vnet] Failed to delete endpoint: hns failed with error : The endpoint was not found. .
2020/10/28 04:46:26 [15764] [cni-net] DEL command completed with err:Failed to delete endpoint: hns failed with error : The endpoint was not found. .
2020/10/28 04:46:26 [15764] Failed to execute network plugin, err:Failed to delete endpoint: hns failed with error : The endpoint was not found. .
2020/10/28 04:46:26 [15764] [cni-net] Plugin stopped.
2020/10/28 04:46:26 [15764] Report plugin error
What you expected to happen:
According to CNI spec: Plugins should generally complete a DEL action without error even if some resources are missing. In this case, if the endpoint is in CNI state, but not in HNS, Azure CNI should just remove it from its state, and return no error.
How to reproduce it:
Add an endpoint object to azure-vnet.json with a non existing hns id, and attempt a CNI delete.
Orchestrator and Version (e.g. Kubernetes, Docker):
Operating System (Linux/Windows):
Windows
Kernel (e.g. uanme -a for Linux or $(Get-ItemProperty -Path "C:\windows\system32\hal.dll").VersionInfo.FileVersion for Windows):
Anything else we need to know?: