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 addition/deletion order when updating endpoint labels #647

Merged
merged 2 commits into from
May 4, 2017

Conversation

tgraf
Copy link
Member

@tgraf tgraf commented May 4, 2017

No description provided.

This is a pure cleanup, no code changes.

Signed-off-by: André Martins <andre@cilium.io>
If the user wanted to modify the existing labels of an endpoint he
could add and delete the same label in the same command (e.g.:
cilium endpoint labels 123 --add foo=bar --del foo=bar). However,
the deletion operation would follow the addition operation which
means the label foo=bar would never be added to endpoint.

This commits changes swaps the order of those operations which means for
thee same label set on the same command for both operatons, the label
will be added to the enpoint.

Signed-off-by: André Martins <andre@cilium.io>
@tgraf tgraf added kind/bug This is a bug in the Cilium logic. stable candidate labels May 4, 2017
@tgraf
Copy link
Member Author

tgraf commented May 4, 2017

@aanm I reworded some of the commits, please confirm if accurate.

@tgraf tgraf requested a review from ianvernon May 4, 2017 01:08
d.conf.ValidLabelPrefixesMU.RUnlock()

if len(addLabels) == 0 || len(delLabels) == 0 {
return NewPutEndpointIDLabelsOK()
if len(addLabels) == 0 && len(delLabels) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

There was this small thing changed.

@tgraf tgraf merged commit dba1bc5 into master May 4, 2017
@tgraf tgraf deleted the update-sec-labels branch May 4, 2017 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants