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

Add log when allocate nodecidr failure #13299

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

konghui
Copy link
Contributor

@konghui konghui commented Sep 27, 2020

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

@konghui konghui requested a review from a team September 27, 2020 04:34
@maintainer-s-little-helper
Copy link

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

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Sep 27, 2020
Copy link
Member

@qmonnet qmonnet left a 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.

pkg/ipam/allocator/podcidr/podcidr.go Outdated Show resolved Hide resolved
pkg/ipam/allocator/podcidr/podcidr.go Outdated Show resolved Hide resolved
@qmonnet qmonnet added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. and removed kind/bug This is a bug in the Cilium logic. labels Sep 28, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 28, 2020
@qmonnet qmonnet self-assigned this Sep 28, 2020
Copy link
Member

@aanm aanm left a 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?

@konghui konghui force-pushed the add_log_when_allocate_nodecidr_failure branch from 66c06b3 to 459a8e4 Compare October 3, 2020 13:57
@maintainer-s-little-helper
Copy link

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
Copy link
Contributor Author

konghui commented Oct 3, 2020

@aanm I am sorry. It should be error required IPv4 pod CIDR not present in node resource not Waiting for CRD. It's my fault. I was update the issue on the top.

@konghui konghui force-pushed the add_log_when_allocate_nodecidr_failure branch from 459a8e4 to 9dad234 Compare October 3, 2020 14:30
@maintainer-s-little-helper
Copy link

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
Copy link
Member

aanm commented Oct 3, 2020

@konghui that makes more sense. Please squash all commits together and sign-off your commit as explained here #13299 (comment)

Copy link
Member

@qmonnet qmonnet left a 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!

pkg/ipam/allocator/podcidr/podcidr.go Outdated Show resolved Hide resolved
pkg/ipam/allocator/podcidr/podcidr.go Outdated Show resolved Hide resolved
@konghui konghui force-pushed the add_log_when_allocate_nodecidr_failure branch from 9dad234 to 9351248 Compare October 9, 2020 04:07
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Oct 9, 2020
@konghui
Copy link
Contributor Author

konghui commented Oct 9, 2020

@konghui that makes more sense. Please squash all commits together and sign-off your commit as explained here #13299 (comment)

done

@konghui konghui force-pushed the add_log_when_allocate_nodecidr_failure branch from 9351248 to cad2d6d Compare October 10, 2020 10:06
Copy link
Member

@qmonnet qmonnet left a 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 {
Copy link
Member

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:

Suggested change
if index < cidrAllocatorsLength - 1 {
if index < cidrAllocatorsLength-1 {

@aanm aanm added needs/triage This issue requires triaging to establish severity and next steps. needs-backport/1.8 release-priority/best-effort The project for target version is not a hard requirement. and removed needs/triage This issue requires triaging to establish severity and next steps. labels Oct 13, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.8.5 Oct 13, 2020
@aanm
Copy link
Member

aanm commented Oct 15, 2020

@konghui can you take a look at the failures? Thanks!

@konghui konghui force-pushed the add_log_when_allocate_nodecidr_failure branch from cad2d6d to 0c25069 Compare October 16, 2020 05:53
@konghui konghui requested a review from aanm October 16, 2020 06:03
@qmonnet
Copy link
Member

qmonnet commented Oct 16, 2020

test-me-please

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 20, 2020
@aanm aanm merged commit ef6ecbd into cilium:master Oct 20, 2020
This was referenced Oct 21, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.8 in 1.8.5 Oct 22, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.8 to Backport done to v1.8 in 1.8.5 Oct 22, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.8 to Backport done to v1.8 in 1.8.5 Oct 22, 2020
christarazi added a commit to christarazi/cilium that referenced this pull request Nov 5, 2020
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 <chris@isovalent.com>
fristonio pushed a commit that referenced this pull request Nov 9, 2020
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 <chris@isovalent.com>
joestringer pushed a commit that referenced this pull request Nov 10, 2020
[ 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 <chris@isovalent.com>
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
joestringer pushed a commit that referenced this pull request Nov 10, 2020
[ 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 <chris@isovalent.com>
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
twpayne pushed a commit that referenced this pull request Nov 13, 2020
[ 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 <chris@isovalent.com>
Signed-off-by: Tom Payne <tom@isovalent.com>
twpayne pushed a commit that referenced this pull request Nov 13, 2020
[ 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 <chris@isovalent.com>
Signed-off-by: Tom Payne <tom@isovalent.com>
aanm pushed a commit that referenced this pull request Nov 17, 2020
[ 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 <chris@isovalent.com>
Signed-off-by: Tom Payne <tom@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. release-priority/best-effort The project for target version is not a hard requirement.
Projects
No open projects
1.8.5
Backport done to v1.8
Development

Successfully merging this pull request may close these issues.

None yet

6 participants