-
Bug
-
Resolution: Done
-
Undefined
-
None
-
4.17.0
-
Moderate
-
No
-
False
-
-
-
Known Issue
-
Done
Description of problem:
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. Create NAD for UDN on ns z1
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: l3-network-ns1
spec:
config: |2
2. Create test pod on namespace z1 and UDN network interface will be attached
oc rsh -n z1 test-rc-xhzfk
~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1360 qdisc noqueue state UP group default
link/ether 0a:58:0a:83:00:20 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.131.0.32/23 brd 10.131.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::858:aff:fe83:20/64 scope link
valid_lft forever preferred_lft forever
3: ovn-udn1@if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1300 qdisc noqueue state UP group default
link/ether 0a:58:c0:a8:00:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.0.3/24 brd 192.168.0.255 scope global ovn-udn1
valid_lft forever preferred_lft forever
inet6 fe80::858:c0ff:fea8:3/64 scope link
valid_lft forever preferred_lft forever
3. Now delete the NAD
oc delete net-attach-def l3-network-ns1 -n z1
networkattachmentdefinition.k8s.cni.cncf.io "l3-network-ns1" deleted
4. in pod the udn interface still there
$ oc rsh -n z1 test-rc-6z9cn
~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if22: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1360 qdisc noqueue state UP group default
link/ether 0a:58:0a:81:02:0e brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.129.2.14/23 brd 10.129.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::858:aff:fe81:20e/64 scope link
valid_lft forever preferred_lft forever
3: ovn-udn1@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1300 qdisc noqueue state UP group default
link/ether 0a:58:c0:a8:01:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.1.3/24 brd 192.168.1.255 scope global ovn-udn1
valid_lft forever preferred_lft forever
inet6 fe80::858:c0ff:fea8:103/64 scope link
valid_lft forever preferred_lft forever
Actual results:
NAD was removed when there is pod is using that
Expected results:
NAD should not be removed when there is pod is using that