diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-01-14 16:01:59 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-01-14 16:52:52 +0100 |
commit | ad9bb80a24777e34a5141a7aa0336baeef3d892f (patch) | |
tree | 787d10da11a2e65d80e7fef492426a058ecf796f | |
parent | a944f906b8de00be0b50f9407d1905ba20f80823 (diff) | |
download | podman-ad9bb80a24777e34a5141a7aa0336baeef3d892f.tar.gz podman-ad9bb80a24777e34a5141a7aa0336baeef3d892f.tar.bz2 podman-ad9bb80a24777e34a5141a7aa0336baeef3d892f.zip |
Bump github.com/cri-o/ocicni to latest master
The changes from https://github.com/cri-o/ocicni/pull/83 are needed
to improve the user experience when using the new network reload command.
see: https://github.com/containers/podman/pull/8571#discussion_r535167473
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go | 32 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
4 files changed, 19 insertions, 21 deletions
@@ -17,7 +17,7 @@ require ( github.com/containers/psgo v1.5.2 github.com/containers/storage v1.24.5 github.com/coreos/go-systemd/v22 v22.1.0 - github.com/cri-o/ocicni v0.2.1-0.20201125151022-df072ea5421c + github.com/cri-o/ocicni v0.2.1-0.20201204103948-b6cbe99b9756 github.com/cyphar/filepath-securejoin v0.2.2 github.com/davecgh/go-spew v1.1.1 github.com/docker/distribution v2.7.1+incompatible @@ -131,8 +131,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cri-o/ocicni v0.2.1-0.20201125151022-df072ea5421c h1:iGaCU6d3oVT0pl8tmvyDhoA/vTDL3IX08akfsKZIy9o= -github.com/cri-o/ocicni v0.2.1-0.20201125151022-df072ea5421c/go.mod h1:vingr1ztOAzP2WyTgGbpMov9dFhbjNxdLtDv0+PhAvY= +github.com/cri-o/ocicni v0.2.1-0.20201204103948-b6cbe99b9756 h1:4T3rzrCSvMgVTR+fm526d+Ed0BurAHGjOaaNFOVoK6E= +github.com/cri-o/ocicni v0.2.1-0.20201204103948-b6cbe99b9756/go.mod h1:vingr1ztOAzP2WyTgGbpMov9dFhbjNxdLtDv0+PhAvY= github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= diff --git a/vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go b/vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go index 7a9f97d1c..d9c1d37db 100644 --- a/vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go +++ b/vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go @@ -102,7 +102,7 @@ func (plugin *cniNetworkPlugin) podUnlock(podNetwork PodNetwork) { fullPodName := buildFullPodName(podNetwork) lock, ok := plugin.pods[fullPodName] if !ok { - logrus.Warningf("Unbalanced pod lock unref for %s", fullPodName) + logrus.Errorf("Cannot find reference in refcount map for %s. Refcount cannot be determined.", fullPodName) return } else if lock.refcount == 0 { // This should never ever happen, but handle it anyway @@ -121,12 +121,12 @@ func newWatcher(confDir string) (*fsnotify.Watcher, error) { // Ensure plugin directory exists, because the following monitoring logic // relies on that. if err := os.MkdirAll(confDir, 0755); err != nil { - return nil, fmt.Errorf("failed to create %q: %v", confDir, err) + return nil, fmt.Errorf("failed to create directory %q: %v", confDir, err) } watcher, err := fsnotify.NewWatcher() if err != nil { - return nil, fmt.Errorf("could not create new watcher %v", err) + return nil, fmt.Errorf("failed to create new watcher %v", err) } defer func() { // Close watcher on error @@ -275,13 +275,13 @@ func loadNetworks(confDir string, cni *libcni.CNIConfig) (map[string]*cniNetwork if strings.HasSuffix(confFile, ".conflist") { confList, err = libcni.ConfListFromFile(confFile) if err != nil { - logrus.Warningf("Error loading CNI config list file %s: %v", confFile, err) + logrus.Errorf("Error loading CNI config list file %s: %v", confFile, err) continue } } else { conf, err := libcni.ConfFromFile(confFile) if err != nil { - logrus.Warningf("Error loading CNI config file %s: %v", confFile, err) + logrus.Errorf("Error loading CNI config file %s: %v", confFile, err) continue } if conf.Network.Type == "" { @@ -290,7 +290,7 @@ func loadNetworks(confDir string, cni *libcni.CNIConfig) (map[string]*cniNetwork } confList, err = libcni.ConfListFromConf(conf) if err != nil { - logrus.Warningf("Error converting CNI config file %s to list: %v", confFile, err) + logrus.Errorf("Error converting CNI config file %s to list: %v", confFile, err) continue } } @@ -321,7 +321,7 @@ func loadNetworks(confDir string, cni *libcni.CNIConfig) (map[string]*cniNetwork if _, ok := networks[confList.Name]; !ok { networks[confList.Name] = cniNet } else { - logrus.Infof("Ignore CNI network %s (type=%v) at %s because already exists", confList.Name, confList.Plugins[0].Network.Type, confFile) + logrus.Infof("Ignored CNI network %s (type=%v) at %s because already exists", confList.Name, confList.Plugins[0].Network.Type, confFile) } if defaultNetName == "" { @@ -348,7 +348,7 @@ func (plugin *cniNetworkPlugin) syncNetworkConfig() error { // Update defaultNetName if it is changeable if plugin.defaultNetName.changeable { plugin.defaultNetName.name = defaultNetName - logrus.Infof("Update default CNI network name to %s", defaultNetName) + logrus.Infof("Updated default CNI network name to %s", defaultNetName) } else { logrus.Debugf("Default CNI network name %s is unchangeable", plugin.defaultNetName.name) } @@ -479,8 +479,8 @@ func (plugin *cniNetworkPlugin) forEachNetwork(podNetwork *PodNetwork, fromCache var newRt *libcni.RuntimeConf cniNet, newRt, err = plugin.loadNetworkFromCache(network.Name, rt) if err != nil { - logrus.Debugf("error loading cached network config: %v", err) - logrus.Debugf("falling back to loading from existing plugins on disk") + logrus.Errorf("error loading cached network config: %v", err) + logrus.Warningf("falling back to loading from existing plugins on disk") } else { // Use the updated RuntimeConf rt = newRt @@ -570,7 +570,7 @@ func (plugin *cniNetworkPlugin) getCachedNetworkInfo(containerID string) ([]NetA cacheFile := filepath.Join(dirPath, fname) bytes, err := ioutil.ReadFile(cacheFile) if err != nil { - logrus.Warningf("failed to read CNI cache file %s: %v", cacheFile, err) + logrus.Errorf("failed to read CNI cache file %s: %v", cacheFile, err) continue } @@ -582,7 +582,7 @@ func (plugin *cniNetworkPlugin) getCachedNetworkInfo(containerID string) ([]NetA }{} if err := json.Unmarshal(bytes, &cachedInfo); err != nil { - logrus.Warningf("failed to unmarshal CNI cache file %s: %v", cacheFile, err) + logrus.Errorf("failed to unmarshal CNI cache file %s: %v", cacheFile, err) continue } if cachedInfo.Kind != libcni.CNICacheV1 { @@ -632,13 +632,12 @@ func (plugin *cniNetworkPlugin) TearDownPodWithContext(ctx context.Context, podN if err := tearDownLoopback(podNetwork.NetNS); err != nil { // ignore error - logrus.Errorf("Ignoring error tearing down loopback interface: %v", err) + logrus.Warningf("Ignoring error tearing down loopback interface: %v", err) } return plugin.forEachNetwork(&podNetwork, true, func(network *cniNetwork, podNetwork *PodNetwork, rt *libcni.RuntimeConf) error { if err := network.deleteFromNetwork(ctx, rt, plugin.cniConfig); err != nil { - logrus.Errorf("Error while removing pod from CNI network %q: %s", network.name, err) - return err + return fmt.Errorf("Error while removing pod from CNI network %q: %s", network.name, err) } return nil }) @@ -718,7 +717,7 @@ func (network *cniNetwork) checkNetwork(ctx context.Context, rt *libcni.RuntimeC result, err = cni.GetNetworkListCachedResult(network.config, rt) if err != nil { - logrus.Errorf("Error GetNetworkListCachedResult: %v", err) + logrus.Errorf("Error getting network list cached result: %v", err) return nil, err } else if result != nil { return result, nil @@ -771,7 +770,6 @@ func (network *cniNetwork) checkNetwork(ctx context.Context, rt *libcni.RuntimeC func (network *cniNetwork) deleteFromNetwork(ctx context.Context, rt *libcni.RuntimeConf, cni *libcni.CNIConfig) error { logrus.Infof("About to del CNI network %s (type=%v)", network.name, network.config.Plugins[0].Network.Type) if err := cni.DelNetworkList(ctx, network.config, rt); err != nil { - logrus.Errorf("Error deleting network: %v", err) return err } return nil diff --git a/vendor/modules.txt b/vendor/modules.txt index b7b8795dd..b5c20e0ca 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -224,7 +224,7 @@ github.com/coreos/go-systemd/v22/dbus github.com/coreos/go-systemd/v22/internal/dlopen github.com/coreos/go-systemd/v22/journal github.com/coreos/go-systemd/v22/sdjournal -# github.com/cri-o/ocicni v0.2.1-0.20201125151022-df072ea5421c +# github.com/cri-o/ocicni v0.2.1-0.20201204103948-b6cbe99b9756 github.com/cri-o/ocicni/pkg/ocicni # github.com/cyphar/filepath-securejoin v0.2.2 github.com/cyphar/filepath-securejoin |