-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kumactl) Only warn about version compatibility where it makes sense
Warn for: apply, config, delete, generate, get, inspect Don't warn for: completion, install, uninstall, version Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
- Loading branch information
1 parent
bbe7b6b
commit 667c3d2
Showing
8 changed files
with
82 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
// RunParentPreRunE checks if the parent command has a PersistentPreRunE set and | ||
// executes it. This is for use in PersistentPreRun and is necessary because | ||
// only the first PersistentPreRun* of the command's ancestors is executed by | ||
// cobra. | ||
func RunParentPreRunE(cmd *cobra.Command, args []string) error { | ||
if p := cmd.Parent(); p != nil && p.PersistentPreRunE != nil { | ||
if err := p.PersistentPreRunE(p, args); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |