1
0
Fork 0
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:
Steven Kang 2025-07-07 11:29:29 +12:00 committed by GitHub
parent c20a8b5a68
commit 0a36d4fbfd
4 changed files with 47 additions and 4 deletions

View file

@ -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)
}