|
|
@ -10,7 +10,6 @@ import ( |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/pkg/errors" |
|
|
|
"github.com/pkg/errors" |
|
|
@ -24,7 +23,7 @@ import ( |
|
|
|
appsv1 "github.com/rancher/k3s/types/apis/apps/v1" |
|
|
|
appsv1 "github.com/rancher/k3s/types/apis/apps/v1" |
|
|
|
batchv1 "github.com/rancher/k3s/types/apis/batch/v1" |
|
|
|
batchv1 "github.com/rancher/k3s/types/apis/batch/v1" |
|
|
|
corev1 "github.com/rancher/k3s/types/apis/core/v1" |
|
|
|
corev1 "github.com/rancher/k3s/types/apis/core/v1" |
|
|
|
v1 "github.com/rancher/k3s/types/apis/k3s.cattle.io/v1" |
|
|
|
"github.com/rancher/k3s/types/apis/k3s.cattle.io/v1" |
|
|
|
rbacv1 "github.com/rancher/k3s/types/apis/rbac.authorization.k8s.io/v1" |
|
|
|
rbacv1 "github.com/rancher/k3s/types/apis/rbac.authorization.k8s.io/v1" |
|
|
|
"github.com/rancher/norman" |
|
|
|
"github.com/rancher/norman" |
|
|
|
"github.com/rancher/norman/pkg/clientaccess" |
|
|
|
"github.com/rancher/norman/pkg/clientaccess" |
|
|
@ -244,15 +243,6 @@ func setupDataDirAndChdir(config *config.Control) error { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func readTokenFile(file string) (string, error) { |
|
|
|
|
|
|
|
content, err := ioutil.ReadFile(file) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return "", err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return strings.TrimSpace(string(content)), nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func printToken(httpsPort int, advertiseIP, prefix, cmd string) { |
|
|
|
func printToken(httpsPort int, advertiseIP, prefix, cmd string) { |
|
|
|
ip := advertiseIP |
|
|
|
ip := advertiseIP |
|
|
|
if ip == "" { |
|
|
|
if ip == "" { |
|
|
|