This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Merged
Conversation
LucilleH
approved these changes
Nov 10, 2022
| } | ||
|
|
||
| if p.initSurverProvider == nil { | ||
| p.initSurverProvider = provider.DefaultInitSurveyProvider(p.clusterProvider) |
There was a problem hiding this comment.
Do we need a separate if statement for this, instead of adding it straight to the Padcli struct above?
Contributor
Author
There was a problem hiding this comment.
This is ugly, but it was the best way I could think of that we always use the correct cluster provider (e.g. if the user of this lib were to pass a custom cluster provider, but not a custom init provider, this ensures we assign it correctly).
If we do this above and there's a custom cluster provider then we will accidentally pass the default cluster provider.
| } | ||
|
|
||
| func WithPersistentPostRunE(r func(cmd *cobra.Command, args []string) error) padcliOption { | ||
| func WithPersistentPostRunE(r CobraFunc) padcliOption { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This splits out init survey into a provider.
I think there's a few more follow ups we can do after this that will make it better, for example
answers.ClusterOption == provider.CreateJetpackClustercondition can be removed (we could add a generic non error println toanswers)How was it tested?
Is this change backwards-compatible?
yes