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

PDI-1836: Add configuration profiles capability #122

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

erikostien-pingidentity
Copy link
Contributor

@erikostien-pingidentity erikostien-pingidentity commented Jul 10, 2024

  • Create a profiles package intended to manage Viper configuration profiles.
  • Create profiles/types.go to manage configuration Option types which link the cobra parameter name, viper key,
    environment variable, and variable type together. Additional utility functions were added to access data from Options.
  • Create profiles/validate.go to validate .pingctl/config.yaml configuration file, including each profile individually. Profile names must be alphanumeric plus dashes or forward slashes. This replaces the previous validate.go file.
  • Create profiles/viper.go to create, manage, and change viper instances. Viper instances are used to scope configuration
    to a specific profile while maintaining the main configuration file. It also adds the notion of deferred binding of env vars and flags, so the user-chosen profile can bind them after initialization (See root.go OnInitialize()).
  • Update multiple tests to use the Option type to retrieve viper key information.
  • Update output functions and Opts type to follow Golang's best practices on repetition and naming.
  • Transition all config get/set/unset commands to use new profile viper instance.
  • Update PingOne provider test version to 1.0.0-rc2.

@erikostien-pingidentity erikostien-pingidentity requested a review from a team as a code owner July 10, 2024 20:08
cmd/root.go Outdated Show resolved Hide resolved
cmd/root.go Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
internal/profiles/validate.go Show resolved Hide resolved
@henryrecker-pingidentity

Just a few very small comments, looks good to me otherwise

@erikostien-pingidentity erikostien-pingidentity merged commit 02292a3 into go-cli Jul 15, 2024
8 checks passed
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.

2 participants