Browse Source

Reset tasks specific to Calico (#3813)

pull/3816/head
Erwan Miran 6 years ago
committed by Kubernetes Prow Robot
parent
commit
2c1dd69891
2 changed files with 20 additions and 1 deletions
  1. 19
      roles/network_plugin/calico/tasks/reset.yml
  2. 2
      roles/reset/tasks/main.yml

19
roles/network_plugin/calico/tasks/reset.yml

@ -0,0 +1,19 @@
---
- name: reset | check dummy0 network device
stat:
path: /sys/class/net/dummy0
register: dummy0
- name: reset | remove the network device created by calico
command: ip link del dummy0
when: dummy0.stat.exists
- name: reset | get remaining routes set by bird
command: ip route show proto bird
register: bird_routes
- name: reset | remove remaining routes set by bird
command: "ip route del {{ bird_route }} proto bird"
with_items: "{{ bird_routes.stdout_lines }}"
loop_control:
loop_var: bird_route

2
roles/reset/tasks/main.yml

@ -205,7 +205,7 @@
- name: reset | include file with reset tasks specific to the network_plugin if exists
include_tasks: "{{ (role_path + '/../network_plugin/' + kube_network_plugin + '/tasks/reset.yml') | realpath }}"
when:
- kube_network_plugin in ['flannel', 'cilium', 'contiv', 'kube-router']
- kube_network_plugin in ['flannel', 'cilium', 'contiv', 'kube-router', 'calico']
tags:
- network

Loading…
Cancel
Save