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 returning non-empty reconcile result and error #4864

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

jonathan-innis
Copy link
Contributor

Fixes #N/A

Description

Since controller-runtime kubernetes-sigs/controller-runtime#2451, a warning will be logged if a controller returns an error and a non-zero result (i.e. a result with a RequeueAfter).

This PR changes the logic of our current controllers to not return both a non-zero result and an error at the same time to prevent warnings from being fired.

2023-10-20T01:28:53.2764885Z     logger.go:130: 2023-10-20T01:28:53.275Z	INFO	common/expectations.go:573	2023-10-20T01:28:49.102Z	DEBUG	controller.awsnodetemplate	discovered security groups	{"commit": "dce7385", "awsnodetemplate": "serpentsunset-29-ahjs7gn4mu", "security-groups": ["sg-0273da947dae25bb0", "sg-09513f2623d9d9b79"]}
2023-10-20T01:28:53.2773218Z         2023-10-20T01:28:49.158Z	INFO	controller	Warning: Reconciler returned both a non-zero result and a non-nil error. The result will always be ignored if the error is non-nil and the non-nil error causes reqeueuing with exponential backoff. For more details, see: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile#Reconciler	{"commit": "dce7385", "controller": "awsnodetemplate", "controllerGroup": "karpenter.k8s.aws", "controllerKind": "***NodeTemplate", "***NodeTemplate": {"name":"serpentsunset-29-ahjs7gn4mu"}, "namespace": "", "name": "serpentsunset-29-ahjs7gn4mu", "reconcileID": "60c54480-e547-4b51-b312-4f2a603b1520"}
2023-10-20T01:28:53.2781222Z         2023-10-20T01:28:49.158Z	ERROR	controller	Reconciler error	{"commit": "dce7385", "controller": "awsnodetemplate", "controllerGroup": "karpenter.k8s.aws", "controllerKind": "***NodeTemplate", "***NodeTemplate": {"name":"serpentsunset-29-ahjs7gn4mu"}, "namespace": "", "name": "serpentsunset-29-ahjs7gn4mu", "reconcileID": "60c54480-e547-4b51-b312-4f2a603b1520", "error": "describing images, InvalidUserID.Malformed: Invalid user id: \"fakeOwnerValue\"\n\tstatus code: 400, request id: 197b5477-2067-4b51-9c8e-9162f8816402"}

How was this change tested?

make presubmit

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jonathan-innis jonathan-innis requested a review from a team as a code owner October 20, 2023 05:41
@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit 581f8f5
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/6532d827ca7e6e00083028f0
😎 Deploy Preview https://deploy-preview-4864--karpenter-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor Author

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Contributor

Snapshot successfully published to oci://071440425669.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:v0-c27fd54a9ea7189bb98b067068b3b0fb4e6514dc.

@jonathan-innis jonathan-innis enabled auto-merge (squash) October 20, 2023 06:31
@jonathan-innis jonathan-innis force-pushed the reconcile-return-fix branch 2 times, most recently from aab6a75 to b8a4cef Compare October 20, 2023 18:18
engedaam
engedaam previously approved these changes Oct 20, 2023
Copy link
Contributor

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Contributor

@engedaam engedaam left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jonathan-innis jonathan-innis merged commit f55af44 into aws:main Oct 20, 2023
11 checks passed
johngmyers pushed a commit to johngmyers/karpenter that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants