-
Notifications
You must be signed in to change notification settings - Fork 5
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
Environment variables overriding provider options have no effect #23
Comments
Hey @dubinsky, it's actually the other way round: provider options take precedence over environment variables. If you want to specify only via env vars you'll need to ensure the provider options are set to their types default value first ( |
@pascalbreuninger thank you for the clarification! If I understand correctly, for the provider to even look at the environment variable corresponding to a provider option, that option has to first be "disarmed" on the provider by setting it to its type's default, for instance, That seems to imply that the options with the option default being the same as the default for the option's type can not be disarmed at all, and environment variables setting those options will always be ignored - for example, In reality, even where in accordance with your clarification supplying the option value in an environment variable should work, it doesn't seem to: $ devpod provider set-options gcloud -o DISK_SIZE=0
$ devpod provider options gcloud | grep DISK_SIZE
DISK_SIZE | false | The disk size to use. | 40 | 0
$ echo $DISK_SIZE
50
$ devpod up github.com/... --open-ide=false
info googleapi: Error 400: Invalid value for field 'resource.disks[0].initializeParams.diskSizeGb': '0'. Must be greater than or equal to 1
$ echo $PROJECT
opentorah-devpod
$ devpod provider add gcloud
done Successfully installed provider gcloud
error cannot list instances: googleapi: Error 403: Compute Engine API has not been used in project opentorah-infra before or it is disabled. If GCP project to use is supplied in the $ echo $CLOUDSDK_CORE_PROJECT
opentorah-devpod
$ echo $PROJECT
$ devpod provider add gcloud
done Successfully installed provider gcloud
done Successfully configured provider 'gcloud'
$ devpod provider options gcloud | grep PROJECT
PROJECT | true | The project id to use. | | opentorah-devpod Design decision to make options on the provider primary and the environment variables secondary (compounded, possibly, by what looks like some implementation bugs) renders environment variables (a "traditional" and "expected" way of overriding settings :)) useless (I am yet to discover any scenario where they have any effect) and documentation's remark Also misleading is the following:
|
Documentation states that the VM instance can be customized by setting options as environment variables. Presumably, this should override options set on the provider - but it does not. Example showing that
DISK_SIZE
override via an environment variable is ignored follows; other environment variables (ZONE
,SERVICE_ACCOUNT
) are also ignored.The text was updated successfully, but these errors were encountered: