فهرست منبع

libnetwork/osl: rename var that collided with import

Also renaming another var for consistency ':-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 سال پیش
والد
کامیت
021e89d702
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      libnetwork/osl/namespace_linux.go

+ 6 - 6
libnetwork/osl/namespace_linux.go

@@ -600,29 +600,29 @@ func (n *networkNamespace) checkLoV6() {
 }
 
 func setIPv6(nspath, iface string, enable bool) error {
-	origns, err := netns.Get()
+	origNS, err := netns.Get()
 	if err != nil {
 		return fmt.Errorf("failed to get current network namespace: %w", err)
 	}
-	defer origns.Close()
+	defer origNS.Close()
 
-	ns, err := netns.GetFromPath(nspath)
+	namespace, err := netns.GetFromPath(nspath)
 	if err != nil {
 		return fmt.Errorf("failed get network namespace %q: %w", nspath, err)
 	}
-	defer ns.Close()
+	defer namespace.Close()
 
 	errCh := make(chan error, 1)
 	go func() {
 		defer close(errCh)
 
 		runtime.LockOSThread()
-		if err = netns.Set(ns); err != nil {
+		if err = netns.Set(namespace); err != nil {
 			errCh <- fmt.Errorf("setting into container netns %q failed: %w", nspath, err)
 			return
 		}
 		defer func() {
-			if err := netns.Set(origns); err != nil {
+			if err := netns.Set(origNS); err != nil {
 				logrus.WithError(err).Error("libnetwork: restoring thread network namespace failed")
 				// The error is only fatal for the current thread. Keep this
 				// goroutine locked to the thread to make the runtime replace it