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

Don't advertise blocks with pending affinity #1712

Merged

Conversation

caseydavenport
Copy link
Member

@caseydavenport caseydavenport commented Feb 28, 2018

Description

In conjunction with projectcalico/libcalico-go#785, this change will make sure that any leaked block affinities won't get advertised by BIRD during the interim before they are cleaned up.

Todos

  • Tests
  • Documentation
  • Release note

Release Note

Fixes a rare bug where a node could in some circumstances advertise /26 blocks that it didn't own

@caseydavenport caseydavenport added this to the Calico v3.1.0 milestone Mar 2, 2018
@caseydavenport caseydavenport added the release-note-required Change has user-facing impact (no matter how small) label Mar 2, 2018
@caseydavenport caseydavenport force-pushed the advertise-confirmed-blocks branch from a29511f to e9ddd11 Compare March 2, 2018 17:42
@caseydavenport caseydavenport force-pushed the advertise-confirmed-blocks branch from e9ddd11 to ae79ed3 Compare March 2, 2018 17:43
@@ -16,7 +16,19 @@ function calico_aggr ()
{{range ls "/"}}
{{$parts := split . "-"}}
{{$cidr := join $parts "/"}}
if ( net = {{$cidr}} ) then { accept; }
if ( net ~ {{$cidr}} ) then { reject; }
{{$affinity := json (getv (printf "/%s" .))}}
Copy link
Contributor

@robbrockbank robbrockbank Mar 3, 2018

Choose a reason for hiding this comment

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

can you change to use range gets and json .Value here, so something like:

{{range gets "/"}}
{{$parts := split .Key "-"}}
{{$cidr := join $parts "/"}}
{{$affinity := json .Value}}

@caseydavenport
Copy link
Member Author

@robbrockbank thanks, check out the new stuff :)

@caseydavenport caseydavenport merged commit 5bf6e66 into projectcalico:master Mar 6, 2018
@caseydavenport caseydavenport deleted the advertise-confirmed-blocks branch March 6, 2018 00:48
@caseydavenport
Copy link
Member Author

Revert for second broken commit here: #1752

@caseydavenport caseydavenport added cherry-pick-completed PR has been cherry-picked and removed cherry-pick-candidate labels Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-completed PR has been cherry-picked release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants