Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

trozet
Copy link
Contributor

@trozet trozet commented Apr 29, 2022

It really isn't necessary and this simplifies the code.

Signed-off-by: Tim Rozet trozet@redhat.com

It really isn't necessary and this simplifies the code.

Signed-off-by: Tim Rozet <trozet@redhat.com>
@trozet
Copy link
Contributor Author

trozet commented Apr 29, 2022

@ricky-rav @msherif1234 PTAL

Copy link
Contributor

@ricky-rav ricky-rav left a 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
Copy link
Contributor

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",
Copy link
Contributor

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{}
Copy link
Contributor

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()
Copy link
Contributor

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 ?

@trozet
Copy link
Contributor Author

trozet commented May 25, 2022

turns out I actually need the cache for #3002 :)

@trozet trozet closed this May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants