-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add log when allocate nodecidr failure #13299
Add log when allocate nodecidr failure #13299
Conversation
Commit 98871ec does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
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 a lot for the PR!
Please find some feedback inline below.
Please also add a Signed-off-by:
tag for your commits as explained in the documentation linked by the bot.
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.
@konghui thank you for the changes. What I don't understand is how you end up with that "Waiting for CRD" error message. Was it because you had an error on the IPAM that cilium-agent could not start and therefore register the CRDs?
66c06b3
to
459a8e4
Compare
Commit 98871ec does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
@aanm I am sorry. It should be error |
459a8e4
to
9dad234
Compare
Commit 98871ec does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
@konghui that makes more sense. Please squash all commits together and sign-off your commit as explained here #13299 (comment) |
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.
Some more nits on the error message, but looks good otherwise, thanks!
9dad234
to
9351248
Compare
done |
9351248
to
cad2d6d
Compare
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, thank you! Please make sure to address the CI checks too, but for my part I'm good with the current version.
|
||
for index, cidrAllocator := range cidrAllocators { | ||
cidrAllocatorsInfo.WriteString(fmt.Sprintf("%s", cidrAllocator.String())) | ||
if index < cidrAllocatorsLength - 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.
Please format your code with gofmt -s
to pass the style checks. In that case, I think it simply expects no space around the minus sign:
if index < cidrAllocatorsLength - 1 { | |
if index < cidrAllocatorsLength-1 { |
@konghui can you take a look at the failures? Thanks! |
cad2d6d
to
0c25069
Compare
test-me-please |
Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: cilium#13299 Signed-off-by: Chris Tarazi <[email protected]>
Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]>
[ upstream commit 8c5c737 ] Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]> Signed-off-by: Jarno Rajahalme <[email protected]>
[ upstream commit 8c5c737 ] Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]> Signed-off-by: Jarno Rajahalme <[email protected]>
[ upstream commit 8c5c737 ] Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]> Signed-off-by: Tom Payne <[email protected]>
[ upstream commit 8c5c737 ] Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]> Signed-off-by: Tom Payne <[email protected]>
[ upstream commit 8c5c737 ] Previously, the nil check was useless because the variable is never going to be nil, as it was initialized to an empty `nodeCIDRs` instance. This made the "Unable to allocate node CIDR" error impossible to surface. This commit fixes this by making the variable not a pointer, but rather a value, and reworking the further checks to ensure that the error in allocating a node CIDR can be surfaced. Fixes: ef6ecbd ("add error log When ipam allocate nodecidr failure") Fixes: #13299 Signed-off-by: Chris Tarazi <[email protected]> Signed-off-by: Tom Payne <[email protected]>
If user enconter an error when ipam allocate nodecidr failure where. It hang at log
required IPv4 pod CIDR not present in node resource
like this issue: #12956
I think it should return a error and show it to the user.
[Edit] See also related PR for IPAM: cilium/ipam#1