forked from kumahq/kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
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 sen…
…se (kumahq#2828) * fix(kumactl) Add method to check server version compatibility Also remove logging with the k8s logger Signed-off-by: Michael Beaumont <mjboamail@gmail.com> * fix(kumactl) Only warn about version compatibility where it makes sense Warn for: apply, delete, generate, get, inspect Don't warn for: completion, config, install, uninstall, version Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
- Loading branch information
1 parent
ef1d211
commit 6030b98
Showing
8 changed files
with
99 additions
and
41 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 | ||
} |