Skip to content

agentmanagement tests - cluster registration token - #5538

Merged
weyfonk merged 2 commits into
rancher:mainfrom
0xavi0:tests-clustes-registration-token
Sep 4, 2026
Merged

agentmanagement tests - cluster registration token#5538
weyfonk merged 2 commits into
rancher:mainfrom
0xavi0:tests-clustes-registration-token

Conversation

@0xavi0

@0xavi0 0xavi0 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR adds testing coverage for the cluster registration token controller.

This PR adds testing coverage for the cluster registration token
controller.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 added this to the v2.16.0 milestone Aug 10, 2026
@0xavi0 0xavi0 self-assigned this Aug 10, 2026
@0xavi0 0xavi0 added this to Fleet Aug 10, 2026
@0xavi0
0xavi0 marked this pull request as ready for review August 10, 2026 15:29
@0xavi0
0xavi0 requested a review from a team as a code owner August 10, 2026 15:29
Copilot AI lite review requested due to automatic review settings August 10, 2026 15:29

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

Adds envtest integration coverage for the ClusterRegistrationToken controller behavior in the agentmanagement suite, including TTL enforcement, generated RBAC, and the derived “cluster-registration-values” Secret.

Changes:

  • Adds reusable objectGone async assertion helper and a newClusterRegistrationToken test constructor.
  • Introduces a comprehensive clusterregistrationtoken_test.go suite validating TTL rejection/expiry, generated ServiceAccount/Role/RoleBinding, values Secret contents, and pruning on deletion.
  • Includes envtest-specific logic to populate the ServiceAccount token Secret (since envtest won’t auto-populate SA token data).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
integrationtests/agentmanagement/helpers_test.go Adds generic “object gone” assertion and a ClusterRegistrationToken factory helper used by new tests.
integrationtests/agentmanagement/clusterregistrationtoken_test.go New integration test suite covering ClusterRegistrationToken lifecycle, RBAC, secret generation, TTL enforcement, and pruning behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@0xavi0 0xavi0 moved this to 👀 In review in Fleet Aug 10, 2026
Comment thread integrationtests/agentmanagement/clusterregistrationtoken_test.go
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@weyfonk
weyfonk merged commit a10c881 into rancher:main Sep 4, 2026
36 of 37 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Fleet Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants