From ef4e34b2892587904ebbc835b026cc695d492e31 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 1 Mar 2019 16:27:07 -0700 Subject: [PATCH] Remove dead code --- pkg/agent/config/config.go | 7 ------- pkg/server/server.go | 12 +----------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index 6639a8176c..c91d038f87 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -199,13 +199,6 @@ func get(envInfo *cmds.Agent) (*config.Node, error) { return nodeConfig, nil } -func defString(val, newVal string) string { - if val == "" { - return newVal - } - return val -} - func getConfig(info *clientaccess.Info) (*config.Control, error) { data, err := clientaccess.Get("/v1-k3s/config", info) if err != nil { diff --git a/pkg/server/server.go b/pkg/server/server.go index b6370efc51..89e7926b5e 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -10,7 +10,6 @@ import ( "os" "path/filepath" "strconv" - "strings" "time" "github.com/pkg/errors" @@ -24,7 +23,7 @@ import ( appsv1 "github.com/rancher/k3s/types/apis/apps/v1" batchv1 "github.com/rancher/k3s/types/apis/batch/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" "github.com/rancher/norman" "github.com/rancher/norman/pkg/clientaccess" @@ -244,15 +243,6 @@ func setupDataDirAndChdir(config *config.Control) error { 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) { ip := advertiseIP if ip == "" {