-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
proxy: Fill in { world | host } destination identity at egress #1615
Conversation
Signed-off-by: Thomas Graf <thomas@cilium.io>
Decoupled the consumable cache from the daemon structure Signed-off-by: Thomas Graf <thomas@cilium.io>
Fixes: #1458 Signed-off-by: Thomas Graf <thomas@cilium.io>
… identity Signed-off-by: Thomas Graf <thomas@cilium.io>
Also improves the unit test to hardcode the identity values that should never ever change again. Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Thomas Graf <thomas@cilium.io>
0557a81
to
e36fc69
Compare
pkg/policy/identity.go
Outdated
@@ -162,16 +172,19 @@ const ( | |||
ID_UNKNOWN NumericIdentity = iota | |||
ID_HOST | |||
ID_WORLD | |||
ID_CLUSTER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use ALL_CAPS in Go names; use CamelCase
pkg/policy/identity.go
Outdated
ID_UNKNOWN NumericIdentity = iota | ||
ID_HOST | ||
ID_WORLD | ||
IdentityUnknown NumericIdentity = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported const IdentityUnknown should have comment (or a comment on this block) or be unexported
2215ca5
to
29d3e0b
Compare
// identity. The SHA is calculated if not already cached. | ||
func (id *Identity) GetLabelsSHA256() string { | ||
if id.LabelsSHA256 == "" { | ||
id.LabelsSHA256 = id.Labels.SHA256Sum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we guarantee the LabelsSHA256
is updated when in change a label in id.Labels
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The labels of an identity never change. If the labels of an endpoint change, a new identity is created/assigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
No description provided.