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

run provider command as a sub command to init #184

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

jacobsalmela
Copy link
Collaborator

@jacobsalmela jacobsalmela commented Dec 29, 2023

Summary and Scope

  • Merging a provider command with the cani init command works ok for one provider, but when adding more, clashes can occur if two providers set the same flags. This change makes a new provider command for each provider, and merges CANI's flags with it. This results in each provider having CANI's flags and their own, without clashing with another provider. To accomplish this, the command name is the same as the provider via the Slug() method, and then when an argument to session init is a valid provider, it executes the providers init command
  • Changes if cmd.Name() == "init"s to if cmd.Parent().Name() == "init" since init calls subcommands
  • this requires one change to a test, which checks csm-specific flags on a fake provider

Risks and Mitigations

Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
@jacobsalmela jacobsalmela self-assigned this Dec 29, 2023
@jacobsalmela jacobsalmela merged commit ec69d78 into main Dec 29, 2023
5 checks passed
@jacobsalmela jacobsalmela deleted the cuddly-spellbinder branch December 29, 2023 19:35
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.

None yet

1 participant