mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
refactor: replace the kubectl
binary with the upstream sdk (#524)
This commit is contained in:
parent
4d4360b86b
commit
bc29419c17
17 changed files with 354 additions and 182 deletions
|
@ -41,8 +41,8 @@ func NewClient(libKubectlAccess *ClientAccess, namespace, kubeconfig string, ins
|
|||
// If server and token are provided, they will be used to connect to the cluster
|
||||
// If neither kubeconfigPath or server and token are provided, an error will be returned
|
||||
func generateConfigFlags(token, server, namespace, kubeconfigPath string, insecure bool) (*genericclioptions.ConfigFlags, error) {
|
||||
if kubeconfigPath == "" && (server == "" || token == "") {
|
||||
return nil, errors.New("must provide either a kubeconfig path or a server and token")
|
||||
if kubeconfigPath == "" && server == "" {
|
||||
return nil, errors.New("must provide either a kubeconfig path or a server")
|
||||
}
|
||||
|
||||
configFlags := genericclioptions.NewConfigFlags(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue