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

add retries around iptable rule removal #402

Merged
merged 3 commits into from
May 18, 2020

Conversation

eytan-avisror
Copy link
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

This is awesome! Thanks for doing this ..

shrinandj
shrinandj previously approved these changes May 13, 2020
cmd/kiam/iptables.go Outdated Show resolved Hide resolved
Copy link
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