Merge pull request #54888 from Cynerva/gkk/fix-iptables-conflict

Automatic merge from submit-queue (batch tested with PRs 54822, 53561, 54888). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix hook failure in kubernetes-worker charm due to iptables conflict

**What this PR does / why we need it**:

This fixes a hook failure that can occur on the kubernetes-worker charm due to iptable conflicts:

```
Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
...
subprocess.CalledProcessError: Command '['iptables', '-P', 'FORWARD', 'ACCEPT']' returned non-zero exit status 4
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

Passing `-w 300` to iptables tells it to wait up to 5 minutes to acquire the xtables lock, rather than aborting immediately.

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-11-01 03:44:24 -07:00 committed by GitHub
commit 741beb6453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -854,7 +854,7 @@ def fix_iptables_for_docker_1_13():
https://github.com/kubernetes/kubernetes/issues/40182
https://github.com/kubernetes/kubernetes/issues/39823
"""
cmd = ['iptables', '-P', 'FORWARD', 'ACCEPT']
cmd = ['iptables', '-w', '300', '-P', 'FORWARD', 'ACCEPT']
check_call(cmd)