apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
797 stars 266 forks source link

Helm chart - cannot unset values.router.configuration safely #4781

Open shaikatzz opened 6 months ago

shaikatzz commented 6 months ago

Describe the bug I would like to provide my own config.yaml file into the container, and in order to do so i have to make router.configuration empty so it will skip setting --config /app/configuration.yaml.

The problem is that if I set this value to empty, it will fail on service creation because of this line: index .Values.router.configuration "health_check").listen

With the following error: Error: template: router/charts/router/templates/service.yaml:21:31: executing "router/charts/router/templates/service.yaml" at <index .Values.router.configuration "health_check">: error calling index: cannot index slice/array with type string

To Reproduce Steps to reproduce the behavior: set this chart as a depedency of a new chart you create an run helm template . --set router.router.configuration={}

Expected behavior should unset configuration safely and let us load our own config file from file system.

dan-catalano-vc commented 5 months ago

I am having similar experience where we are unable to successfully use APOLLO_ROUTER_CONFIG_PATH b/c the following cli option is always set regardless if router.configuration is undefined in the Values

This reference lists and describes the options supported by the router binary. Where indicated, some of these options can also be provided via an environment variable. If an option is provided both ways, the command-line value takes precedence.

sure seems like --config should not be populated if the values file doesn't define router.configuration given the Chart

        - args:
            - '--config'
            - /app/configuration.yaml

having the same experience with helm template locally, as well as using ArgoCD's version of helm

version.BuildInfo{Version:"v3.14.3", GitCommit:"f03cc04caaa8f6d7c3e67cf918929150cf6f3f12", GitTreeState:"clean", GoVersion:"go1.22.1"}
dan-catalano-vc commented 5 months ago

created a discussion on the topic https://github.com/apollographql/router/discussions/4934