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

fix(core): do not require a config file if required env vars are set #2550

Merged
merged 3 commits into from
Oct 17, 2022

Conversation

jawher
Copy link
Contributor

@jawher jawher commented Oct 17, 2022

Issue

A regression was introduced in the 2.6.0 release where the CLI will exit with the following error:

scaleway-sdk-go: cannot read config file /root/.config/scw/config.yaml: no such file or directory

Even though all the required env vars SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_ORGANIZATION_ID, SCW_DEFAULT_ORGANIZATION_ID, SCW_ZONE are set.

The same invocation of the CLI used to work fine with the 2.5.x releases

Proposed Fix

Change the client creation logic to no longer require a configuration file, but instead:

  • first load config from env
  • if a config file is found, then load it and merge it with the env config

Release note for CHANGELOG:

fix regression where a config file was required even if all required env vars are set

Copy link
Member

@Codelax Codelax left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for your contribution

@remyleone remyleone merged commit 1ead5cc into scaleway:master Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants