UNCLASSIFIED - NO CUI

Feature Request: Map-based format support for Fleet configuration

Summary

Add backwards-compatible support for defining packages, agentPolicies, and package_policies as maps in addition to the existing list format.

Why: Map-based configuration is easier to merge/override in downstream Helm values files (e.g., BigBang umbrella chart) and provides clearer identification of policies by key rather than array index.

Changes

  • chart/templates/_kibana-config.tpl - Added ~55 lines of map-to-list conversion logic with sortAlpha for deterministic output
  • chart/values.yaml - Updated comments documenting both list and map formats
  • chart/tests/kibana_test.yaml - Added 5 unit tests covering all format combinations (6 total Kibana tests)
  • CHANGELOG.md - Added [Unreleased] section documenting the feature

Conversion Rules

Field Map Key Becomes
packages name
agentPolicies id
package_policies id AND name

Example

List Format (original - still supported)

kibana:
  agents:
    packages:
      - name: fleet_server
        version: latest
    agentPolicies:
      - id: staging-fleet
        name: staging-fleet
        package_policies:
          - name: fleet_server-1
            id: fleet_server-1
            package:
              name: fleet_server

Map Format (new)

kibana:
  agents:
    packages:
      fleet_server:              # key becomes 'name'
        version: latest
    agentPolicies:
      staging-fleet:             # key becomes 'id'
        name: staging-fleet
        package_policies:
          fleet_server-1:        # key becomes 'id' and 'name'
            package:
              name: fleet_server

Both formats produce identical Kibana configuration output.

Testing

  • helm unittest chart - All 6 Kibana tests pass (9 total across all suites)
  • Deterministic output verified (multiple helm template runs produce identical output)
  • Alphabetical sorting confirmed (aaa-* before zzz-*)
  • Tested with production-like staging values (~500 lines of Fleet agent policies)

Checklist

  • Chart version unchanged (feature addition, not breaking change)
  • CHANGELOG.md updated
  • Unit tests added
  • Backwards compatible with existing list-based configurations
  • No changes to default values behavior
Edited by Carl Lawson