-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[usage] Use a config file to configure usage component #11028
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
Conversation
dd5b141
to
9641e47
Compare
f0eac60
to
3edbf37
Compare
"path/filepath" | ||
) | ||
|
||
func getStripeConfig(cfg *experimental.Config) (corev1.Volume, corev1.VolumeMount, string, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exists because it's essential to have a single place that can give us all of - volume, mount and the path where it will be. Before, these were scattered around which also scattered the logic for deciding if to add the argument
/werft run with-preview 👍 started the job as gitpod-build-mp-usage-config-file.6 |
983ede3
to
65ef78c
Compare
/werft run with-preview 👍 started the job as gitpod-build-mp-usage-config-file.11 |
/werft run with-preview 👍 started the job as gitpod-build-mp-usage-config-file.12 |
65ef78c
to
f17c0a1
Compare
f17c0a1
to
fe4babe
Compare
/werft run with-preview 👍 started the job as gitpod-build-mp-usage-config-file.15 |
if err != nil { | ||
log.WithError(err).Fatal("Failed to start usage server.") | ||
} | ||
}, | ||
} | ||
|
||
localConfig := path.Join(os.ExpandEnv("GOMOD"), "..", "config.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case here? Why do we expect config.json
one level up from the go.mod
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOMOD
points to where the go.mod
is defined, in our case that is GOMOD="/workspace/gitpod/components/usage/go.mod"
. The ..
drops the filename and we then join it with our desired filename.
See playground
Description
Moves usage component configuration into a file (mounted as a ConfigMap) instead of providing arguments on the command line.
Related Issue(s)
Fixes #10753
How to test
Release Notes
Documentation
NONE
Werft options: