Log a warning when remote-deployments-poll-interval gets clamped #2354
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: <a href="https://github.com/knative/operator/pull/2354#" title="Author self-approved">magic-peach</a>
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 open>
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
</details>
<!-- META={"approvers":["dprotaso"]} -->
Welcome @magic-peach! It looks like this is your first PR to knative/operator 🎉
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.
</details>
/ok-to-test
/lgtm
Thank you 🙏
I'd rather see bool returned from this function, as it states clamping is happening. Then act accordingly to log warning.
Codecov Report
:x: Patch coverage is
33.33333% with 4 lines in your changes missing coverage. Please review.:white_check_mark: Project coverage is 65.88%. Comparing base (
074eebe) to head (e9b3431).:warning: Report is 1 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/reconciler/knativeeventing/controller.go | 0.00% | 2 Missing :warning: |
| pkg/reconciler/knativeserving/controller.go | 0.00% | 2 Missing :warning: |
<details><summary>Additional details and impacted files</summary>
@@ 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
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
dsimansk
magic-peach
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).