Fix lint failures

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2021-07-03 04:24:58 -07:00 committed by Brad Davidson
parent a5355f0827
commit e95b75409a
5 changed files with 8 additions and 19 deletions

View File

@ -12,10 +12,7 @@ func (lb *LoadBalancer) writeConfig() error {
if err != nil {
return err
}
if err := util.WriteFile(lb.configFile, string(configOut)); err != nil {
return err
}
return nil
return util.WriteFile(lb.configFile, string(configOut))
}
func (lb *LoadBalancer) updateConfig() error {

View File

@ -247,11 +247,7 @@ func genEncryptedNetworkInfo(controlConfig *config.Control, runtime *config.Cont
}
controlConfig.IPSECPSK = psk
if err := ioutil.WriteFile(runtime.IPSECKey, []byte(psk+"\n"), 0600); err != nil {
return err
}
return nil
return ioutil.WriteFile(runtime.IPSECKey, []byte(psk+"\n"), 0600)
}
func getServerPass(passwd *passwd.Passwd, config *config.Control) (string, error) {

View File

@ -1210,18 +1210,14 @@ func (e *ETCD) Restore(ctx context.Context) error {
return err
}
logrus.Infof("Pre-restore etcd database moved to %s", oldDataDir)
sManager := snapshot.NewV3(nil)
if err := sManager.Restore(snapshot.RestoreConfig{
return snapshot.NewV3(nil).Restore(snapshot.RestoreConfig{
SnapshotPath: e.config.ClusterResetRestorePath,
Name: e.name,
OutputDataDir: etcdDBDir(e.config),
OutputWALDir: walDir(e.config),
PeerURLs: []string{e.peerURL()},
InitialCluster: e.name + "=" + e.peerURL(),
}); err != nil {
return err
}
return nil
})
}
// snapshotRetention iterates through the snapshots and removes the oldest

View File

@ -11,12 +11,12 @@ import (
"github.com/rancher/k3s/pkg/deploy"
"github.com/rancher/k3s/pkg/generated/controllers/k3s.cattle.io"
"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/batch"
"github.com/rancher/wrangler/pkg/generated/controllers/core"
"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/sirupsen/logrus"
"k8s.io/apimachinery/pkg/apis/meta/v1/validation"

View File

@ -7,10 +7,10 @@ import (
"strconv"
"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/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/relatedresource"
"github.com/rancher/wrangler/pkg/slice"