Skip to content
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

add ability to inject environment variables globally into launched processes #9329

Merged
merged 9 commits into from
Jan 10, 2022

Conversation

jrhizor
Copy link
Contributor

@jrhizor jrhizor commented Jan 6, 2022

Specifically this will enable us to inject values like the SENTRY_DSN when it is set in the .env files or Helm. It will also enable us to do things like set LOG_LEVEL (if it's respected at least) for launched containers in Docker and Kubernetes.

This partially addresses #9104 (we can do a separate PR will actually introduce the sentry tracking -- I'd prefer for someone on connectors to do this to get a sense of where these overrides have to be added on OSS and cloud).

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Jan 6, 2022
@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 05:48 Inactive
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

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

Just had one small question but overall looks good to me!

@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 19:24 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 19:31 Inactive
@michel-tricot
Copy link
Contributor

Have you considered this pattern instead of serializing json in env variables?

JOB_DEFAULT_ENV_[KEY1]=abc
JOB_DEFAULT_ENV_[KEY2]=def
...

@jrhizor
Copy link
Contributor Author

jrhizor commented Jan 10, 2022

Good idea with the prefix. Switched to that instead. Once this passes the build on Github I'll merge.

@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 00:05 Inactive
}

public EnvConfigs(final Function<String, String> getEnv) {
public EnvConfigs(final Function<String, String> getEnv, final Supplier<Set<String>> getAllEnvKeys) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick. Can you add Javadoc to this class to explain the prefix setup?

@jrhizor
Copy link
Contributor Author

jrhizor commented Jan 10, 2022

Good call on the Javadoc. After realizing I didn't have a good way to explain it I cleaned up the interface instead.

@jrhizor jrhizor temporarily deployed to more-secrets January 10, 2022 00:31 Inactive
@jrhizor jrhizor merged commit e556697 into master Jan 10, 2022
@jrhizor jrhizor deleted the jrhizor/add-env-injection-support branch January 10, 2022 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants