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
Apply environment variables during init
#656
Comments
I would like to help implement these changes. I have a question though: As far as I can tell, // ipfs/ipfs-cluster/cluster_config.go
func (cfg *Config) LoadJSON(raw []byte) error {
jcfg := &configJSON{}
// ...
// override json config with env var
err = envconfig.Process(cfg.ConfigKey(), jcfg)
if err != nil {
return err
}
// ...
} An easy solution would be to rename |
Yes, there is a comment next to them: The names of the env vars will be those of The only problem is this will make envars always take precedence over whatever values |
I do agree that adding a method like I find the first idea you proposed more robust: adding an What do you think? |
I see this, the problem is you can't do The ideal way is that env-vars get applied on All in all it just seemed easier to stick a line in ToJSON, but it's def peculiar logically speaking. |
Basic information
Description
Users find it weird that
CLUSTER_SECRET
can be used duringinit
to set the CLUSTER_SECRET in the config, but thatCLUSTER_LEAVEONSHUTDOWN
does not do anythiing during init but takes effect when running the cluster peer.We should apply the environment variables during init. Doing it in
Default()
makesDefault()
no longer use defaults, so maybe we can haveApplyEnvVars()
or something called afterwards.Source: https://discuss.ipfs.io/t/modifying-services-json-in-local-docker-cluster/4775/6
The text was updated successfully, but these errors were encountered: