mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix: kubectl
sdk - capture fatal error and return instead of exiting 1 [r7s-371] (#841)
This commit is contained in:
parent
c20a8b5a68
commit
0a36d4fbfd
4 changed files with 47 additions and 4 deletions
|
@ -3,6 +3,7 @@ package libkubectl
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/cli-runtime/pkg/genericiooptions"
|
||||
|
@ -61,3 +62,7 @@ func generateConfigFlags(token, server, namespace, kubeconfigPath string, insecu
|
|||
|
||||
return configFlags, nil
|
||||
}
|
||||
|
||||
func newKubectlFatalError(code int, msg string) error {
|
||||
return fmt.Errorf("kubectl fatal error (exit code %d): %s", code, msg)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue