Skip to content

Log a warning when remote-deployments-poll-interval gets clamped - #2354

Open
magic-peach wants to merge 1 commit into
knative:mainfrom
magic-peach:fix/poll-interval-clamp-warning-log
Open

magic-peach wants to merge 1 commit into
knative:mainfrom
magic-peach:fix/poll-interval-clamp-warning-log

Conversation

@magic-peach

Copy link
Copy Markdown

This repo has no PR template, so this is a plain factual description.

What changed: added RemoteDeploymentsPollIntervalWasClamped in pkg/reconciler/common/poll_interval_flag.go, and a conditional logger.Warnf call in both pkg/reconciler/knativeserving/controller.go and pkg/reconciler/knativeeventing/controller.go, right next to the existing startup log line that reports the resolved poll interval.

Why: the flag help text and the README's CLI flags table both document that a remote-deployments-poll-interval value below 1s falls back to the default with a warning log entry. The code only clamped the value silently, so a misconfigured flag gave no signal at all. Confirmed via git log that this was an oversight in the PR that introduced the flag (#2267), not something already tracked.

How tested: go build ./... and go test on pkg/reconciler/common, pkg/reconciler/knativeserving, and pkg/reconciler/knativeeventing, all green, including 9 new and existing cases for the poll interval helpers. Rebuilt and retested against the current tip of main immediately before opening this PR.

Confirmed no existing issue or PR covers this (searched by flag name and by keyword).

The flag help text and README both document that values below 1s
fall back to the default with a warning, but the code only clamped
the value silently, so a misconfigured flag gave no signal at all.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
@knative-prow

knative-prow Bot commented Sep 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: magic-peach
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow

knative-prow Bot commented Sep 16, 2026

Copy link
Copy Markdown

Welcome @magic-peach! It looks like this is your first PR to knative/operator 🎉

@knative-prow knative-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2026
@knative-prow

knative-prow Bot commented Sep 16, 2026

Copy link
Copy Markdown

Hi @magic-peach. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow
knative-prow Bot requested review from kahirokunn and matzew September 16, 2026 02:29
@kahirokunn

Copy link
Copy Markdown
Member

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2026
@kahirokunn

Copy link
Copy Markdown
Member

/lgtm
Thank you 🙏

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 16, 2026
Comment on lines 36 to 42
// RemoteDeploymentsPollIntervalValue returns the configured poll interval, clamping values below 1s to the default.
func RemoteDeploymentsPollIntervalValue() time.Duration {
if remoteDeploymentsPollIntervalFlag < time.Second {
return defaultRemoteDeploymentsPollInterval
}
return remoteDeploymentsPollIntervalFlag
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd rather see bool returned from this function, as it states clamping is happening. Then act accordingly to log warning.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.88%. Comparing base (074eebe) to head (e9b3431).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/reconciler/knativeeventing/controller.go 0.00% 2 Missing ⚠️
pkg/reconciler/knativeserving/controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2354      +/-   ##
==========================================
- Coverage   65.95%   65.88%   -0.08%     
==========================================
  Files          56       56              
  Lines        2682     2688       +6     
==========================================
+ Hits         1769     1771       +2     
- Misses        777      781       +4     
  Partials      136      136              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants