Skip to content

feat(helm): add commandArgs for custom entrypoint #8567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 19, 2023
Merged

Conversation

ericpaulsen
Copy link
Member

@ericpaulsen ericpaulsen commented Jul 17, 2023

this PR adds the commandArgs value to support passing custom arguments into the Coder container.

one of our large customers needs this feature to pass in a custom PostgreSQL connection URL environment variable. they are looking to reference the database password from a volume mounted on the container. the below example meets this requirement:

coder:
  command:
    - /bin/sh
    - -c 
    - CODER_PG_CONNECTION_URL=postgresql://coder:$(cat /mnt/postgres-pass/secret.json | jq -r .password)@coder-db.coder.svc.cluster.local:5432/coder /opt/coder server
  commandArgs: []

@deansheather
Copy link
Member

I would prefer we just provided a .Values.coder.commandArgs value (default []) instead, and if it's set we wouldn't set any args on the command.

e.g.:

coder:
  command: /bin/sh
  commandArgs:
    - '-c'
    - 'echo "hello world" && coder server'

Default to [] instead of [ 'server' ] because we change it between server and wsproxy server in the templates.

Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented above

@ericpaulsen ericpaulsen requested a review from deansheather July 17, 2023 21:30
@ericpaulsen
Copy link
Member Author

thanks @deansheather - how should we specify server in the coder.yaml template?

@ammario ammario removed their request for review July 17, 2023 21:52
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a test in the tests dir, you can add a test by adding it to the list in the _test.go file and adding a corresponding values file with the same name in the testdata dir. Then run make --always-make update-golden-files to save the generated chart for your test. Double check the outputted file before committing to make sure it looks as you would expect

@ericpaulsen ericpaulsen changed the title feat(helm): add args conditional for custom entrypoint feat(helm): add commandArgs for custom entrypoint Jul 18, 2023
@ericpaulsen ericpaulsen requested a review from deansheather July 18, 2023 13:35
@ericpaulsen ericpaulsen requested a review from bpmct July 18, 2023 16:14
@deansheather deansheather enabled auto-merge (squash) July 19, 2023 00:37
@deansheather deansheather merged commit 164b816 into main Jul 19, 2023
@deansheather deansheather deleted the helm-args branch July 19, 2023 00:50
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants