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

Auto egress IP code reorg in prep for future features #19603

Merged

Conversation

danwinship
Copy link
Contributor

After talking with @knobunc , here's the first half of #19578 as a separate PR... that way we can merge this sooner and if there are any bugs in the reorg part we'll catch them early.

Mostly this is just code reorganization; the only user-visible change is:

In preparation for later fully supporting multiple NetNamespace
EgressIPs, begin sanity-checking all of them (so that if namespace A
has EgressIPs ["1.2.3.4", "1.2.3.6"] and namespace B has EgressIPs
["1.2.3.5", "1.2.3.6"], that's considered an error even though
"1.2.3.6" would never get used by the current code).

@openshift/sig-networking PTAL

danwinship added 2 commits May 2, 2018 08:59
Instead of trying to do it entirely in terms of "egress IPs whose
status has changed", track "egress IPs whose status has changed" and
"namespaces whose status has changed". This simplifies the handling of
namespaces that are blocked due to duplicate Egress IPs, and will
later make it easier to handle activating the next Egress IP for a
namespace when the current one stops working.
In preparation for later fully supporting multiple NetNamespace
EgressIPs, begin sanity-checking all of them (so that if namespace A
has EgressIPs ["1.2.3.4", "1.2.3.6"] and namespace B has EgressIPs
["1.2.3.5", "1.2.3.6"], that's considered an error even though
"1.2.3.6" would never get used by the current code).
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 3, 2018
@pravisankar
Copy link

/retest

Copy link
Contributor

@dcbw dcbw left a comment

Choose a reason for hiding this comment

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

/lgtm

func (eip *egressIPWatcher) egressIPChanged(eg *egressIPInfo) {
eip.changedEgressIPs = append(eip.changedEgressIPs, eg)
for _, ns := range eg.namespaces {
eip.changedNamespaces = append(eip.changedNamespaces, ns)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might the same namespace would be added to the list multiple times? If so do we care?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might the same namespace would be added to the list multiple times? If so do we care?

It gets converted to a map (and thus de-duped) later one. (Why isn't it a map to start with? Um... It probably made sense in some earlier version of the code)

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2018
@openshift-merge-robot openshift-merge-robot merged commit 9e0aabb into openshift:master May 7, 2018
@danwinship danwinship deleted the auto-egress-ip-3.10-updates branch May 8, 2018 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/networking lgtm Indicates that a PR is ready to be merged. sig/networking size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants