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
Operator gc incluster identities only #17589
Operator gc incluster identities only #17589
Conversation
Seems Cilium agent failed with the |
@ArthurChiao could you please rebase the PR on top of latest master? The newest runtime Docker images and VM images should contain |
@ArthurChiao I think CI had a legitimate failure:
|
b3a332c
to
a0dfaf8
Compare
4b9ff36
to
c551747
Compare
/test |
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.
Thank you for the patch. LGTM me overall.
Would it make sense to have a struct with the max and min IDs, instead of passing them around as arguments? The initialization and checking if an id is within range could be encoded in this structure.
pkg/allocator/allocator.go
Outdated
@@ -265,11 +266,15 @@ type Backend interface { | |||
// After creation, IDs can be allocated with Allocate() and released with | |||
// Release() | |||
func NewAllocator(typ AllocatorKey, backend Backend, opts ...AllocatorOption) (*Allocator, error) { | |||
// Calculate initial ID range with cluster ID | |||
minID := option.Config.ClusterID<<identity.ClusterIDShift + 1 | |||
maxID := minID + (1<<identity.ClusterIDShift - 1) |
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.
Not very familiar with this code, but do ids start at 1 (not 0)?
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.
Thanks for your comments!
Would it make sense to have a struct with the max and min IDs, instead of passing them around as arguments? The initialization and checking if an id is within range could be encoded in this structure.
I'll have a look.
Not very familiar with this code, but do ids start at 1 (not 0)?
I saw the underlying allocator has a minID of 1: https://github.com/cilium/cilium/blob/master/pkg/allocator/allocator.go#L271.
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.
Thanks for your comments!
Would it make sense to have a struct with the max and min IDs, instead of passing them around as arguments? The initialization and checking if an id is within range could be encoded in this structure.
I'll have a look.
To be clear, this is a suggestion, not intended to block the PR. Feel free to ignore it or leave it as a followup.
Not very familiar with this code, but do ids start at 1 (not 0)?
I saw the underlying allocator has a minID of 1: https://github.com/cilium/cilium/blob/master/pkg/allocator/allocator.go#L271.
Ah, makes sense, thanks!
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.
From a janitor's perspective: LGTM.
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.
LGTM
c551747
to
123654b
Compare
Fix: cilium#16805 Signed-off-by: ArthurChiao <arthurchiao@hotmail.com>
1. Calculate identity range after well-known identities are initialized 2. Calculate identity range more accurately 3. Include the invalid min/max identity ID in error log Ref: 7048088 Signed-off-by: ArthurChiao <arthurchiao@hotmail.com>
123654b
to
e3bc9c6
Compare
/test Job 'Cilium-PR-Runtime-net-next' failed and has not been observed before, so may be related to your PR: Click to show.Test Name
Failure Output
If it is a flake, comment Job 'Cilium-PR-K8s-1.20-kernel-5.4' failed and has not been observed before, so may be related to your PR: Click to show.Test Name
Failure Output
If it is a flake, comment Job 'Cilium-PR-K8s-1.21-kernel-4.19' failed and has not been observed before, so may be related to your PR: Click to show.Test Name
Failure Output
If it is a flake, comment |
/test-1.21-4.19 |
/test-1.20-5.4 |
/test-runtime Job 'Cilium-PR-K8s-1.21-kernel-4.19' failed and has not been observed before, so may be related to your PR: Click to show.Test Name
Failure Output
If it is a flake, comment |
A tentative change as a follow-up of #16825 #16825 (comment).
To make the changes clear, I added a new commit on top of the previous PR.
If all things are done, I can squash them. @jrajahalme @aanm Thanks!