UNCLASSIFIED - NO CUI

feat(kibana): add map-based format support for Fleet configuration

General MR

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

Relevant logs/screenshots

No visual changes. Feature verified via helm unittest and helm template output comparison.

Linked Issue

Upgrade Notices

N/A

Relevant logs/screenshots

No visual changes. Feature verified via helm unittest and helm template output comparison.

helm unittest chart -u

### Chart [ elasticsearch-kibana ] chart

 PASS  test bigbang/istio/authorizationPolicies/template.yaml   chart/tests/authorizationPolicies_template_test.yaml
 PASS  test elasticsearch.yaml  chart/tests/elasticsearch_test.yaml
 PASS  test kibana.yaml chart/tests/kibana_test.yaml

Charts:      1 passed, 1 total
Test Suites: 3 passed, 3 total
Tests:       9 passed, 9 total
Snapshot:    2 passed, 2 total
Time:        133.27583ms

Linked Issue

issue

Edited by Carl Lawson

Merge request reports

Loading