Skip to content

[BUG] Helm Template Kustomize Rending Fails - Agents - 0.7.9 #1225

@egallis31

Description

@egallis31

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Controller Service

🚦 Impact/Severity

Minor inconvenience

🐛 Bug Description

The argo-rollouts-agent subchart (and ALL other agent subcharts) are rendered and included in the final manifests even when explicitly disabled via agents.{agent-name}.enabled: false in the Helm values. This violates the expected conditional dependency behavior defined in the chart's Chart.yaml.

According to the chart's conditional logic (condition: argo-rollouts-agent.enabled in Chart.yaml dependencies), setting this value to false should prevent the subchart from being rendered entirely. However, all agent CRDs are created regardless of their enabled status, and is producing a kustomize rendering error.

🔄 Steps To Reproduce

  1. Create a values.yaml file with the following configuration:
agents:
  argo-rollouts-agent:
    enabled: false
  promql-agent:
    enabled: true
  cilium-policy-agent:
    enabled: true
  cilium-debug-agent:
    enabled: true
  # All other agents disabled
  observability-agent:
    enabled: false
  helm-agent:
    enabled: false
  k8s-agent:
    enabled: false
  kgateway-agent:
    enabled: false
  istio-agent:
    enabled: false
  cilium-manager-agent:
    enabled: false
  1. Render the kagent Helm chart with the values:
helm template kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent \
  --version 0.7.9 \
  -f values.yaml
  1. Search for Agent CRDs in the output:
helm template kagent oci://ghcr.io/kagent-dev/kagent/helm/kagent \
  --version 0.7.9 \
  -f values.yaml | grep -A2 "kind: Agent" | grep "name:"
  1. Observe that ALL agents are present in the output, not just the 3 enabled ones

🤔 Expected Behavior

When agents.{agent-name}.enabled: false is set in the values, that agent's subchart should NOT be rendered. The output should only contain Agent CRDs for explicitly enabled agents.

Expected agents with the example values above:

  • promql-agent
  • cilium-policy-agent
  • cilium-debug-agent

Total expected: 3 Agent CRDs

All other agents with enabled: false should NOT appear in the rendered output.

📱 Actual Behavior

ALL Agent CRDs are rendered despite their enabled status.

Output from test command (Helm 3.16.3 and Helm 4.0.5):

  name: argo-rollouts-conversion-agent  # ← enabled: false - Should NOT be present
  name: cilium-debug-agent              # ✓ enabled: true - CORRECT
  name: cilium-manager-agent            # ← enabled: false - Should NOT be present
  name: cilium-policy-agent             # ✓ enabled: true - CORRECT
  name: helm-agent                      # ← enabled: false - Should NOT be present
  name: istio-agent                     # ← enabled: false - Should NOT be present
  name: k8s-agent                       # ← enabled: false - Should NOT be present
  name: kgateway-agent                  # ← enabled: false - Should NOT be present
  name: observability-agent             # ← enabled: false - Should NOT be present
  name: promql-agent                    # ✓ enabled: true - CORRECT

Expected count: 3 agents (only those with enabled: true)
Actual count: 10 agents (all agents render regardless of enabled value)

The conditional dependency system defined in Chart.yaml is not working as expected on either Helm 3 or Helm 4. When attempting to render it fails due to a duplicate deployment key. During ArgoCD Application deployment, this produces the kustomize rendering failure attached, no matter if agents are explicitly ALL disabled or enabled.

💻 Environment

  • Operating System: macOS (development), Talos Linux (production cluster)
  • Kubernetes Version: 1.34 (ARM cluster)
  • Kubernetes Provider: Self-hosted (Talos Linux on bare metal)
  • Helm Version: Tested with both Helm 3.16.3 and Helm 4.0.5 - bug reproduces on both versions
  • kagent Chart Version: 0.7.9 (attempted upgrade from working 0.7.8)
  • Chart Source: OCI (oci://ghcr.io/kagent-dev/kagent/helm/kagent)
  • Deployment Method: ArgoCD with Kustomize (kustomize build --enable-helm)

🔧 CLI Bug Report

Not applicable - this is a Helm chart template issue, not a runtime controller issue.

🔍 Additional Context

Verification of Chart.yaml Source

According to the kagent repository source (verified via DeepWiki):

  • helm/kagent/Chart-template.yaml has changed how to define the conditional dependency:
    - name: argo-rollouts-agent
      version: ${VERSION}
      repository: file://../agents/argo-rollouts
      condition: argo-rollouts-agent.enabled
  • This conditional logic was added in commit 4067b28 on 2025-07-31
  • This conditional logic was updated recently on a previous commit
  • The helm/kagent/values.yaml default is enabled: true for all agents
  • Similar conditional logic exists for ALL agent subcharts

The source was recently updated which appears to introduce this issue

Helm Version Testing

Tested with:

  • Helm 3.16.3 (latest stable v3): Bug reproduces
  • Helm 4.0.5 (latest stable v4): Bug reproduces

This rules out Helm version-specific regressions and confirms the issue is in the kagent chart packaging or structure.

📋 Logs

Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = `kustomize build <path to cached source>/applications/overlays/arm/kagent --enable-helm --helm-kube-version 1.34` failed exit status 1: Error: map[string]interface {}(nil): yaml: unmarshal errors: line 188: mapping key "deployment" already defined at line 20

📷 Screenshots

N/A - Terminal output provided in "Actual Behavior" section above.

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions