Skip to content

tyk-pump: TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME hardcoded, cannot be overridden via values #489

Description

@tshtark

Description

The Mongo Aggregate Pump's collection name is hardcoded as a literal string in components/tyk-pump/templates/deployment-pmp.yaml and exposes no values key to override it. Chart users who need to change where rollups are written must work around this with pump.extraEnvs, which produces a duplicate env entry in the rendered Pod spec.

Affected

components/tyk-pump/templates/deployment-pmp.yaml (~line 246):

- name: TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME
  value: "tyk_analytics_pump"

The neighbouring mongoGraphPump.collectionName (values.yaml ~line 344) and sqlGraphPump.tableName follow the configurable pattern. The aggregate pump should match.

Steps to reproduce

  1. helm install tyk-pump tyk-helm/tyk-pump --set 'pump.backend={mongo,prometheus}'
  2. Try to point the aggregate pump at a different collection via values.
  3. Observe: no values key exists. The only workaround is pump.extraEnvs, which produces a duplicate env entry. The rendered Pod has both the chart's hardcoded tyk_analytics_pump and the user's override.
kubectl get deploy <pump> -o jsonpath='{range .spec.template.spec.containers[0].env[?(@.name=="TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME")]}{.name}={.value}{"\n"}{end}'
# TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME=tyk_analytics_pump
# TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME=tyk_analytics_aggregates

Effective value is the last-wins entry, but duplicate env keys are fragile (ServerSideApply rejects them; strategic-merge re-orders are undefined).

Expected

A values key — for example pump.mongoAggregatePump.collectionName — that lets operators override the aggregate collection without resorting to extraEnvs. Default value preserved so the change is non-breaking.

Proposed fix (additive, no behavior change)

  • Add pump.mongoAggregatePump.collectionName: "" to components/tyk-pump/values.yaml (alongside the existing mongoGraphPump stanza).
  • Template the value in deployment-pmp.yaml:
    - name: TYK_PMP_PUMPS_MONGOAGGREGATE_META_COLLECTIONNAME
      value: "{{ default "tyk_analytics_pump" .Values.pump.mongoAggregatePump.collectionName }}"
  • README updated for the new value.

Happy to send the PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions