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

Avoid return of both error and result #18

Merged
merged 9 commits into from
Sep 18, 2024
Merged

Conversation

3schwartz
Copy link
Owner

In some cases both errors and result with re-queue was returned. This gave error

INFO    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 

Changed to only returning the error and really on the controllers exponential backoff.

Also made the time between reconciliations configurable through environment variable REQUEUE_AFTER.

@jcchavezs
Copy link

jcchavezs commented Sep 13, 2024

my 2p: I am usually in favor of including the units in the name for time variables, REQUEUE_AFTER=2 does not tell anything, shall we use REQUEUE_AFTER_MS or REQUEUE_AFTER_SECS or just call REQUEUE_AFTER and specify it is seconds an only attempt to parse integers.

@3schwartz
Copy link
Owner Author

my 2p: I am usually in favor of including the units in the name for time variables, REQUEUE_AFTER=2 does not tell anything, shall we use REQUEUE_AFTER_MS or REQUEUE_AFTER_SECS or just call REQUEUE_AFTER and specify it is seconds an only attempt to parse integers.

Great comment and I agree 👏

I chose to suffix the environment variable with _DURATION to indicate flexibility in the time unit, allowing any valid duration value to be parsed successfully. This avoids binding the variable to a specific time unit.

@jcchavezs
Copy link

I chose to suffix the environment variable with _DURATION to indicate flexibility in the time unit, allowing any valid duration value to be parsed successfully. This avoids binding the variable to a specific time unit.

Sounds useful but ambiguous so I suggest we document it extensively with examples.

@3schwartz
Copy link
Owner Author

3schwartz commented Sep 14, 2024

I chose to suffix the environment variable with _DURATION to indicate flexibility in the time unit, allowing any valid duration value to be parsed successfully. This avoids binding the variable to a specific time unit.

Sounds useful but ambiguous so I suggest we document it extensively with examples.

Added documentation for configuration from both flags and environment variables.

@3schwartz 3schwartz merged commit f9ca28f into main Sep 18, 2024
8 checks passed
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