Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

add retries around iptable rule removal#402

Merged
Joseph-Irving merged 3 commits intouswitch:masterfrom
eytan-avisror:iptables
May 18, 2020
Merged

add retries around iptable rule removal#402
Joseph-Irving merged 3 commits intouswitch:masterfrom
eytan-avisror:iptables

Conversation

@eytan-avisror
Copy link
Copy Markdown
Contributor

@eytan-avisror eytan-avisror commented May 13, 2020

Fixes #396

This adds basic retries around removing the IPTable rule for kiam-agent when the pod is terminated.

Given the process is exiting anyway, we cannot really 'guarantee' removal, but these retries will make it highly unlikely that a rule is left behind.

The call to Remove() gets deferred regardless of error anyway, so we might as well retry internally.

kiam/cmd/kiam/agent.go

Lines 68 to 70 in 6e07571

if opts.iptablesRemove {
defer rules.Remove()
}

@shrinandj
Copy link
Copy Markdown

This is awesome! Thanks for doing this ..

shrinandj
shrinandj previously approved these changes May 13, 2020
Copy link
Copy Markdown
Contributor

@Joseph-Irving Joseph-Irving left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Joseph-Irving Joseph-Irving merged commit 92855a4 into uswitch:master May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iptables - should have retries in cases where it fails to update

3 participants