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

feat(core): add scw.MergeProfiles command #234

Merged
merged 3 commits into from
Nov 13, 2019

Conversation

QuentinBrosse
Copy link
Contributor

@QuentinBrosse QuentinBrosse commented Nov 13, 2019

Usage example:

// Get Scaleway config active profile
config, _ := scw.LoadConfig()
configProfile, _ := config.GetActiveProfile()

// Get Scaleway env active profile
envProfile := scw.LoadEnvProfile()

// Get flag values
flagProfile := &scw.Profile{
	DefaultOrganizationID: scw.StringPtr("f121706b-2091-429b-a93a-c41b8ef4a068"),
}

// Merge profiles
profile := scw.MergeProfiles(configProfile, envProfile, flagProfile)

// Make custom validation or other stuff here...

// Create a Scaleway client
client, _ = scw.NewClient(scw.WithProfile(profile))

scw/config.go Outdated Show resolved Hide resolved
@QuentinBrosse QuentinBrosse changed the title feat(core): add scw.MergeProfile command feat(core): add scw.MergeProfiles command Nov 13, 2019
@QuentinBrosse QuentinBrosse marked this pull request as ready for review November 13, 2019 16:22
scw/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jerome-quere jerome-quere left a comment

Choose a reason for hiding this comment

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

LGTM

@QuentinBrosse QuentinBrosse merged commit ea25b42 into scaleway:master Nov 13, 2019
@QuentinBrosse QuentinBrosse deleted the merge-profiles branch November 29, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants