Skip to content

Propagate CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING to fleet-agent#5085

Merged
0xavi0 merged 2 commits into
rancher:mainfrom
0xavi0:main-5060-pass-gvk-error-mapping-to-agent
May 8, 2026
Merged

Propagate CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING to fleet-agent#5085
0xavi0 merged 2 commits into
rancher:mainfrom
0xavi0:main-5060-pass-gvk-error-mapping-to-agent

Conversation

@0xavi0
Copy link
Copy Markdown
Contributor

@0xavi0 0xavi0 commented May 7, 2026

The controller now forwards the CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING env variable to the agent deployment, following the same pattern used by EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM.

The env var name is defined as a single exported constant (EnvVarWranglerCheckGVKErrorMapping) in internal/config, replacing the package-private copy that existed in the summary package.

Refers to: #5060

Additional Information

Checklist

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

The controller now forwards the CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING
env variable to the agent deployment, following the same pattern used by
EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM.

The env var name is defined as a single exported constant
(EnvVarWranglerCheckGVKErrorMapping) in internal/config, replacing the
package-private copy that existed in the summary package.

Refers to: rancher#5060

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 added this to the v2.15.0 milestone May 7, 2026
@0xavi0 0xavi0 self-assigned this May 7, 2026
@0xavi0 0xavi0 added the kind/bug label May 7, 2026
@0xavi0 0xavi0 added this to Fleet May 7, 2026
@0xavi0 0xavi0 marked this pull request as ready for review May 7, 2026 13:40
Copilot AI review requested due to automatic review settings May 7, 2026 13:40
@0xavi0 0xavi0 requested a review from a team as a code owner May 7, 2026 13:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 propagates the CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING environment variable from the controller to the downstream fleet-agent deployment so that Wrangler-based health summarization behaves consistently across management and downstream clusters (per issue #5060).

Changes:

  • Added a shared exported constant EnvVarWranglerCheckGVKErrorMapping in internal/config and updated summarizer code/tests to use it.
  • Updated the agent deployment manifest generation to inject CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING into the agent container, sourced from the controller’s own environment.
  • Added a controller-side manifest test verifying the env var is present and carries through the expected value.

Reviewed changes

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

Show a summary per file
File Description
internal/config/config.go Introduces EnvVarWranglerCheckGVKErrorMapping constant to centralize the env var name.
internal/cmd/controller/agentmanagement/agent/manifest.go Injects the Wrangler mapping env var into the generated fleet-agent Deployment manifest.
internal/cmd/controller/agentmanagement/agent/manifest_test.go Adds tests to validate the new env var is present in the rendered agent manifest.
internal/cmd/agent/deployer/summary/summarizers.go Switches summarizer initialization to read the env var via the new shared constant.
internal/cmd/agent/deployer/summary/summarizers_test.go Updates tests to set the env var using the shared constant.

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

Comment thread internal/cmd/controller/agentmanagement/agent/manifest.go
Comment thread internal/cmd/controller/agentmanagement/agent/manifest_test.go
@0xavi0 0xavi0 marked this pull request as draft May 7, 2026 13:52
@kkaempf kkaempf moved this to 👀 In review in Fleet May 7, 2026
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 marked this pull request as ready for review May 7, 2026 14:30
Copy link
Copy Markdown
Contributor

@weyfonk weyfonk left a comment

Choose a reason for hiding this comment

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

LGTM :)

@0xavi0 0xavi0 merged commit f7db26d into rancher:main May 8, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Fleet May 8, 2026
0xavi0 added a commit that referenced this pull request May 8, 2026
…) (#5092)

* Propagate CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING to fleet-agent

The controller now forwards the CATTLE_WRANGLER_CHECK_GVK_ERROR_MAPPING
env variable to the agent deployment, following the same pattern used by
EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM.

The env var name is defined as a single exported constant
(EnvVarWranglerCheckGVKErrorMapping) in internal/config, replacing the
package-private copy that existed in the summary package.

Refers to: #5060

---------

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants