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

Fix identity assignment when labels are changed #3104

Merged
merged 2 commits into from
Mar 12, 2018
Merged

Conversation

aanm
Copy link
Member

@aanm aanm commented Mar 11, 2018

Summary of changes:

  • Re assign identity based on OpLabels
  • Create new identity when endpoint labels change
create new identity when endpoint labels change and re assign identity based on all endpoint labels when restoring

Reported by @mrdima

@aanm aanm added kind/bug This is a bug in the Cilium logic. pending-review priority/high This is considered vital to an upcoming release. area/daemon Impacts operation of the Cilium daemon. release-note/bug This PR fixes an issue in a previous release of Cilium. labels Mar 11, 2018
@aanm aanm requested a review from a team March 11, 2018 16:05
@aanm aanm requested a review from a team as a code owner March 11, 2018 16:05
@aanm
Copy link
Member Author

aanm commented Mar 11, 2018

test-me-please

@aanm
Copy link
Member Author

aanm commented Mar 11, 2018

test-me-please

@aanm
Copy link
Member Author

aanm commented Mar 11, 2018

test-me-please

Copy link
Member

@ianvernon ianvernon left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -1768,7 +1768,9 @@ func (e *Endpoint) identityLabelsChanged(owner Owner, myChangeRev int) error {
return nil
}

if e.SecurityIdentity != nil && string(e.SecurityIdentity.Labels.SortedList()) != string(newLabels.SortedList()) {
if e.SecurityIdentity != nil &&
Copy link
Member

Choose a reason for hiding this comment

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

Am I missing the change here or is this just a cosmetic change?

Copy link
Member Author

Choose a reason for hiding this comment

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

!= -> ==

daemon/state.go Outdated
ep.SecurityIdentity.Labels = l

identity, _, err := identityPkg.AllocateIdentity(ep.SecurityIdentity.Labels)
l, _ := labels.FilterLabels(ep.OpLabels.AllLabels())
Copy link
Member

Choose a reason for hiding this comment

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

This also includes disabled labels. That doesn't seem right. I think you want to use e.OpLabels.IdentityLabels

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, awesome, that's exactly what I want.

Reported-by: @mrdima
Signed-off-by: André Martins <andre@cilium.io>
Reported-by: @mrdima
Signed-off-by: André Martins <andre@cilium.io>
@aanm
Copy link
Member Author

aanm commented Mar 12, 2018

test-me-please

@aanm aanm requested a review from tgraf March 12, 2018 21:33
@aanm aanm added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 12, 2018
@tgraf tgraf merged commit a290961 into master Mar 12, 2018
@tgraf tgraf deleted the new-labels-assigned branch March 12, 2018 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon Impacts operation of the Cilium daemon. kind/bug This is a bug in the Cilium logic. priority/high This is considered vital to an upcoming release. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants