diff --git a/cmd/k3s/main.go b/cmd/k3s/main.go index ea615b7114..8353e7c3fa 100644 --- a/cmd/k3s/main.go +++ b/cmd/k3s/main.go @@ -105,13 +105,13 @@ func getAssetAndDir(dataDir string) (string, string) { func extract(dataDir string) (string, error) { // first look for global asset folder so we don't create a HOME version if not needed - asset, dir := getAssetAndDir(datadir.DefaultDataDir) + _, dir := getAssetAndDir(datadir.DefaultDataDir) if _, err := os.Stat(dir); err == nil { logrus.Debugf("Asset dir %s", dir) return dir, nil } - asset, dir = getAssetAndDir(dataDir) + asset, dir := getAssetAndDir(dataDir) if _, err := os.Stat(dir); err == nil { logrus.Debugf("Asset dir %s", dir) return dir, nil diff --git a/pkg/agent/flannel/flannel.go b/pkg/agent/flannel/flannel.go index 60d1bc65f2..030cdaed5e 100644 --- a/pkg/agent/flannel/flannel.go +++ b/pkg/agent/flannel/flannel.go @@ -122,7 +122,7 @@ func WriteSubnetFile(path string, nw ip.IP4Net, ipMasq bool, bn backend.Network) // Write out the first usable IP by incrementing // sn.IP by one sn := bn.Lease().Subnet - sn.IP += 1 + sn.IP++ fmt.Fprintf(f, "FLANNEL_NETWORK=%s\n", nw) fmt.Fprintf(f, "FLANNEL_SUBNET=%s\n", sn) diff --git a/pkg/agent/flannel/setup.go b/pkg/agent/flannel/setup.go index 364708e0ce..8fb5d29165 100644 --- a/pkg/agent/flannel/setup.go +++ b/pkg/agent/flannel/setup.go @@ -35,7 +35,7 @@ const ( ] } ` - netJson = `{ + netJSON = `{ "Network": "%CIDR%", "Backend": { "Type": "vxlan" @@ -99,5 +99,5 @@ func createFlannelConf(config *config.Node) error { return nil } return util.WriteFile(config.FlannelConf, - strings.Replace(netJson, "%CIDR%", config.AgentConfig.ClusterCIDR.String(), -1)) + strings.Replace(netJSON, "%CIDR%", config.AgentConfig.ClusterCIDR.String(), -1)) } diff --git a/pkg/cli/cmds/server.go b/pkg/cli/cmds/server.go index 7dc3490d57..eeb4de522e 100644 --- a/pkg/cli/cmds/server.go +++ b/pkg/cli/cmds/server.go @@ -16,7 +16,7 @@ type Server struct { DisableAgent bool KubeConfigOutput string KubeConfigMode string - KnownIPs cli.StringSlice + KnownIPs cli.StringSlice } var ServerConfig Server @@ -96,8 +96,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { EnvVar: "K3S_KUBECONFIG_MODE", }, cli.StringSliceFlag{ - Name: "tls-san", - Usage: "Add additional hostname or IP as a Subject Alternative Name in the TLS cert", + Name: "tls-san", + Usage: "Add additional hostname or IP as a Subject Alternative Name in the TLS cert", Value: &ServerConfig.KnownIPs, }, NodeIPFlag, diff --git a/pkg/deploy/stage.go b/pkg/deploy/stage.go index dc625090aa..3fc83f7d0b 100644 --- a/pkg/deploy/stage.go +++ b/pkg/deploy/stage.go @@ -2,11 +2,12 @@ package deploy import ( "bytes" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" "io/ioutil" "os" "path/filepath" + + "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) func Stage(dataDir string, templateVars map[string]string, skipList []string) error { diff --git a/pkg/server/server.go b/pkg/server/server.go index 0f893fb89f..dad051ce0d 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -137,8 +137,7 @@ func startNorman(ctx context.Context, config *Config) (string, error) { }, } - ctx, _, err = normanConfig.Build(ctx, nil) - if err != nil { + if _, _, err = normanConfig.Build(ctx, nil); err != nil { return "", err } diff --git a/pkg/servicelb/controller.go b/pkg/servicelb/controller.go index 11e0bbae31..f9b5eda911 100644 --- a/pkg/servicelb/controller.go +++ b/pkg/servicelb/controller.go @@ -222,7 +222,7 @@ func (h *handler) newDeployment(svc *core.Service) (*apps.Deployment, error) { for _, node := range nodes { if Ready.IsTrue(node) { - replicas += 1 + replicas++ } if replicas >= 2 { break