Commit e95b7540 authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Fix lint failures

parent a5355f08
...@@ -12,10 +12,7 @@ func (lb *LoadBalancer) writeConfig() error { ...@@ -12,10 +12,7 @@ func (lb *LoadBalancer) writeConfig() error {
if err != nil { if err != nil {
return err return err
} }
if err := util.WriteFile(lb.configFile, string(configOut)); err != nil { return util.WriteFile(lb.configFile, string(configOut))
return err
}
return nil
} }
func (lb *LoadBalancer) updateConfig() error { func (lb *LoadBalancer) updateConfig() error {
......
...@@ -247,11 +247,7 @@ func genEncryptedNetworkInfo(controlConfig *config.Control, runtime *config.Cont ...@@ -247,11 +247,7 @@ func genEncryptedNetworkInfo(controlConfig *config.Control, runtime *config.Cont
} }
controlConfig.IPSECPSK = psk controlConfig.IPSECPSK = psk
if err := ioutil.WriteFile(runtime.IPSECKey, []byte(psk+"\n"), 0600); err != nil { return ioutil.WriteFile(runtime.IPSECKey, []byte(psk+"\n"), 0600)
return err
}
return nil
} }
func getServerPass(passwd *passwd.Passwd, config *config.Control) (string, error) { func getServerPass(passwd *passwd.Passwd, config *config.Control) (string, error) {
......
...@@ -1210,18 +1210,14 @@ func (e *ETCD) Restore(ctx context.Context) error { ...@@ -1210,18 +1210,14 @@ func (e *ETCD) Restore(ctx context.Context) error {
return err return err
} }
logrus.Infof("Pre-restore etcd database moved to %s", oldDataDir) logrus.Infof("Pre-restore etcd database moved to %s", oldDataDir)
sManager := snapshot.NewV3(nil) return snapshot.NewV3(nil).Restore(snapshot.RestoreConfig{
if err := sManager.Restore(snapshot.RestoreConfig{
SnapshotPath: e.config.ClusterResetRestorePath, SnapshotPath: e.config.ClusterResetRestorePath,
Name: e.name, Name: e.name,
OutputDataDir: etcdDBDir(e.config), OutputDataDir: etcdDBDir(e.config),
OutputWALDir: walDir(e.config), OutputWALDir: walDir(e.config),
PeerURLs: []string{e.peerURL()}, PeerURLs: []string{e.peerURL()},
InitialCluster: e.name + "=" + e.peerURL(), InitialCluster: e.name + "=" + e.peerURL(),
}); err != nil { })
return err
}
return nil
} }
// snapshotRetention iterates through the snapshots and removes the oldest // snapshotRetention iterates through the snapshots and removes the oldest
......
...@@ -11,12 +11,12 @@ import ( ...@@ -11,12 +11,12 @@ import (
"github.com/rancher/k3s/pkg/deploy" "github.com/rancher/k3s/pkg/deploy"
"github.com/rancher/k3s/pkg/generated/controllers/k3s.cattle.io" "github.com/rancher/k3s/pkg/generated/controllers/k3s.cattle.io"
"github.com/rancher/k3s/pkg/version" "github.com/rancher/k3s/pkg/version"
"github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/crd"
"github.com/rancher/wrangler/pkg/generated/controllers/apps" "github.com/rancher/wrangler/pkg/generated/controllers/apps"
"github.com/rancher/wrangler/pkg/generated/controllers/batch" "github.com/rancher/wrangler/pkg/generated/controllers/batch"
"github.com/rancher/wrangler/pkg/generated/controllers/core" "github.com/rancher/wrangler/pkg/generated/controllers/core"
"github.com/rancher/wrangler/pkg/generated/controllers/rbac" "github.com/rancher/wrangler/pkg/generated/controllers/rbac"
"github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/crd"
"github.com/rancher/wrangler/pkg/start" "github.com/rancher/wrangler/pkg/start"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
......
...@@ -7,10 +7,10 @@ import ( ...@@ -7,10 +7,10 @@ import (
"strconv" "strconv"
"github.com/rancher/k3s/pkg/version" "github.com/rancher/k3s/pkg/version"
appclient "github.com/rancher/wrangler/pkg/generated/controllers/apps/v1"
coreclient "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/apply" "github.com/rancher/wrangler/pkg/apply"
"github.com/rancher/wrangler/pkg/condition" "github.com/rancher/wrangler/pkg/condition"
appclient "github.com/rancher/wrangler/pkg/generated/controllers/apps/v1"
coreclient "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/objectset" "github.com/rancher/wrangler/pkg/objectset"
"github.com/rancher/wrangler/pkg/relatedresource" "github.com/rancher/wrangler/pkg/relatedresource"
"github.com/rancher/wrangler/pkg/slice" "github.com/rancher/wrangler/pkg/slice"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment