Skip to content

Sensible agent check in defaults#5240

Open
weyfonk wants to merge 4 commits into
rancher:mainfrom
weyfonk:sensible-agent-check-in-defaults
Open

Sensible agent check in defaults#5240
weyfonk wants to merge 4 commits into
rancher:mainfrom
weyfonk:sensible-agent-check-in-defaults

Conversation

@weyfonk

@weyfonk weyfonk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This ensures that an agent check-in interval cannot be set to a zero duration.

Additional Information

Checklist

- [ ] I have updated the documentation via a pull request in the fleet-product-docs repository.

@weyfonk weyfonk force-pushed the sensible-agent-check-in-defaults branch from c9cb7f3 to 07c8930 Compare June 5, 2026 11:11
@kkaempf kkaempf added this to Fleet Jun 9, 2026
@kkaempf kkaempf added this to the v2.16.0 milestone Jun 9, 2026
@kkaempf

kkaempf commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@weyfonk tentatively setting milestone to 2.16. 🤔

@weyfonk weyfonk force-pushed the sensible-agent-check-in-defaults branch from 07c8930 to f652b15 Compare June 15, 2026 15:52
weyfonk added 3 commits June 16, 2026 17:46
This ensures that creating a new agent bundle fails with an agent
check-in interval set to 0.
This adds a check on the agent check-in interval to cluster import, for
consistency with agent bundle updates.
Patching the `fleet-controller` config map must include a non-zero agent
check-in interval, otherwise cluster registration fails.
@weyfonk weyfonk force-pushed the sensible-agent-check-in-defaults branch from f652b15 to d7367f7 Compare June 16, 2026 15:46
@weyfonk weyfonk marked this pull request as ready for review June 16, 2026 16:03
@weyfonk weyfonk requested a review from a team as a code owner June 16, 2026 16:03
Copilot AI review requested due to automatic review settings June 16, 2026 16:03

Copilot AI left a comment

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.

Pull request overview

This PR adds validation around the configured agent check-in interval to prevent a zero-duration value from being used, and updates unit/e2e tests to reflect the new behavior.

Changes:

  • Add controller-side checks that reject a zero agent check-in interval during bundle generation and cluster import.
  • Add/adjust unit tests to cover the new validation and keep existing tests passing.
  • Update an e2e patch payload to include a non-zero agentCheckinInterval.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
internal/cmd/controller/agentmanagement/controllers/manageagent/manageagent.go Rejects zero check-in interval when generating agent bundles.
internal/cmd/controller/agentmanagement/controllers/manageagent/manageagent_test.go Adds a new test for the zero-interval error and updates existing tests to set a non-zero interval.
internal/cmd/controller/agentmanagement/controllers/cluster/import.go Rejects zero check-in interval during manager-initiated cluster import flow.
e2e/multi-cluster/installation/agent_test.go Ensures the e2e config patch sets a non-zero agentCheckinInterval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cmd/controller/agentmanagement/controllers/manageagent/manageagent.go Outdated
Comment thread internal/cmd/controller/agentmanagement/controllers/cluster/import.go Outdated
Negative durations are now also taken into account.
@weyfonk weyfonk force-pushed the sensible-agent-check-in-defaults branch from ae8a9fb to 53d3d65 Compare June 17, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants