-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove egress firewall cache #2959
Conversation
It really isn't necessary and this simplifies the code. Signed-off-by: Tim Rozet <trozet@redhat.com>
@ricky-rav @msherif1234 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -189,9 +189,18 @@ func (oc *Controller) addEgressFirewall(egressFirewall *egressfirewallapi.Egress | |||
ef.Lock() | |||
defer ef.Unlock() | |||
// there should not be an item already in egressFirewall map for the given Namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: so this comment is now outdated
fws = append(fws, fw.Name) | ||
} | ||
} | ||
return fmt.Errorf("error attempting to add egressFirewall %s to namespace %s when it already has an egressFirewalls: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe "...when it already has egressFirewall(s): %s"
if err != nil { | ||
return fmt.Errorf("unable to check number of existing egress firewalls: %v", err) | ||
} else if len(existing) > 1 { | ||
fws := []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would the same egfw exits more than once in the same ns ? I wonder if len(existing) > 1 is sufficient to flag the error ?
@@ -189,9 +189,18 @@ func (oc *Controller) addEgressFirewall(egressFirewall *egressfirewallapi.Egress | |||
ef.Lock() | |||
defer ef.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need to lock now giving the changes u did to the delete ?
turns out I actually need the cache for #3002 :) |
It really isn't necessary and this simplifies the code.
Signed-off-by: Tim Rozet trozet@redhat.com