From 24869ddf2128da458338d18842cddb58d849ecfd Mon Sep 17 00:00:00 2001 From: yuzhiquan Date: Thu, 28 Nov 2019 19:26:45 +0800 Subject: [PATCH] remove []byte trans, handle func error --- pkg/agent/containerd/containerd.go | 2 +- pkg/agent/netpol/utils.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/agent/containerd/containerd.go b/pkg/agent/containerd/containerd.go index fe829ed6ba..9c71e88f0a 100644 --- a/pkg/agent/containerd/containerd.go +++ b/pkg/agent/containerd/containerd.go @@ -197,7 +197,7 @@ func getPrivateRegistries(ctx context.Context, cfg *config.Node) (*templates.Reg return nil, err } logrus.Infof("Using registry config file at %s", cfg.AgentConfig.PrivateRegistry) - if err := yaml.Unmarshal([]byte(privRegistryFile), &privRegistries); err != nil { + if err := yaml.Unmarshal(privRegistryFile, &privRegistries); err != nil { return nil, err } return privRegistries, nil diff --git a/pkg/agent/netpol/utils.go b/pkg/agent/netpol/utils.go index 74980890f9..c4c7a48950 100644 --- a/pkg/agent/netpol/utils.go +++ b/pkg/agent/netpol/utils.go @@ -246,8 +246,8 @@ func (entry *Entry) Del() error { if err != nil { return err } - entry.Set.Parent.Save() - return nil + + return entry.Set.Parent.Save() } // Test wether an entry is in a set or not. Exit status number is zero if the