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

adjustments in for preparation for hpcm/ngi providers #186

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

jacobsalmela
Copy link
Collaborator

@jacobsalmela jacobsalmela commented Jan 8, 2024

Summary and Scope

  • moves all init() functions to main.go by making each package's
    init() public (Init()) so they can be run in a specific order
  • uses a new RegisterProviderCommand to add provider versions of each
    comand as a subcommand to cani's command. this currently requires the
    passing of a provider name for all calls but easily allows for each
    provider to define their own settings and not clash with each other
  • adds a utils.CloneCommand() funciton to clone a cobra command, which
    providers can use to create and modify the commands as needed
  • converts recommendations.Print() method to a provider-specific
    method: root.D.PrintRecommendations(cmd, args, recommendations)
  • changes some variable names from bootstrapCmd to caniCmd to better
    distinguish cani vs. provider
  • moves additional cray-sauce like cabinet vlans out of the cmd
    package and into the csm package where it belongs
  • updates provider.ProviderCommands interface for all
    currently-supported commands
  • adjusts test to call csm, which will begin to adjust tests for
    multiple providers
  • adjusts help fixtures as needed
  • converts some CSM DEBUG statements to TRACE since development will
    be minimal on CSM and less of that info is relevant to multiple
    providers
  • changes some cmd.Name() conditionals to cmd.Parent().Name()
    since the provider command is a sub command
  • updated makeprovider command for changes (some stupid changes, but
    they meet the immediate need)

Risks and Mitigations

arguments to existing tests.  the print statements changed slightly in a
few places so that is updated as well

Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
- moves all `init()` functions to `main.go` by making each package's
  `init()` public (`Init()`) so they can be run in a specific order
- uses a new `RegisterProviderCommand` to add provider versions of each
  comand as a subcommand to cani's command.  this currently requires the
  passing of a provider name for all calls but easily allows for each
  provider to define their own settings and not clash with each other
- adds a `utils.CloneCommand()` funciton to clone a cobra command, which
  providers can use to create and modify the commands as needed
- converts `recommendations.Print()` method to a provider-specific
  method: `root.D.PrintRecommendations(cmd, args, recommendations)`
- changes some variable names from `bootstrapCmd` to `caniCmd` to better
  distinguish cani vs. provider
- moves additional cray-sauce like cabinet vlans out of the `cmd`
  package and into the `csm` package where it belongs
- updates `provider.ProviderCommands` interface for all
  currently-supported commands
- adjusts test to call `csm`, which will begin to adjust tests for
  multiple providers
- adjusts help fixtures as needed
- converts some CSM `DEBUG` statements to `TRACE` since development will
  be minimal on CSM and less of that info is relevant to multiple
  providers
- changes some `cmd.Name()` conditionals to `cmd.Parent().Name()`
  since the provider command is a sub command
- updated `makeprovider` command for changes (some stupid changes, but
  they meet the immediate need)

Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
@jacobsalmela jacobsalmela self-assigned this Jan 8, 2024
Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
@jacobsalmela jacobsalmela changed the title Prep for hpcm ngi providers adjustments in for preparation for hpcm/ngi providers Jan 8, 2024
@jacobsalmela jacobsalmela marked this pull request as ready for review January 8, 2024 17:51
@jacobsalmela jacobsalmela merged commit 2943102 into main Jan 8, 2024
5 checks passed
@jacobsalmela jacobsalmela deleted the prep-for-hpcm-ngi-providers branch January 8, 2024 17:54
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.

1 participant