Explorar o código

Merge pull request #12534 from Mashimiao/delete-unused-function-from-drive

clenaup: delete unused function getEnv
Alexander Morozov %!s(int64=10) %!d(string=hai) anos
pai
achega
d2ce1076a4
Modificáronse 2 ficheiros con 0 adicións e 21 borrados
  1. 0 10
      daemon/execdriver/lxc/init.go
  2. 0 11
      daemon/execdriver/native/driver.go

+ 0 - 10
daemon/execdriver/lxc/init.go

@@ -141,13 +141,3 @@ func setupWorkingDirectory(args *InitArgs) error {
 	}
 	}
 	return nil
 	return nil
 }
 }
-
-func getEnv(args *InitArgs, key string) string {
-	for _, kv := range args.Env {
-		parts := strings.SplitN(kv, "=", 2)
-		if parts[0] == key && len(parts) == 2 {
-			return parts[1]
-		}
-	}
-	return ""
-}

+ 0 - 11
daemon/execdriver/native/driver.go

@@ -8,7 +8,6 @@ import (
 	"os"
 	"os"
 	"os/exec"
 	"os/exec"
 	"path/filepath"
 	"path/filepath"
-	"strings"
 	"sync"
 	"sync"
 	"syscall"
 	"syscall"
 	"time"
 	"time"
@@ -349,16 +348,6 @@ func (d *driver) Stats(id string) (*execdriver.ResourceStats, error) {
 	}, nil
 	}, nil
 }
 }
 
 
-func getEnv(key string, env []string) string {
-	for _, pair := range env {
-		parts := strings.Split(pair, "=")
-		if parts[0] == key {
-			return parts[1]
-		}
-	}
-	return ""
-}
-
 type TtyConsole struct {
 type TtyConsole struct {
 	console libcontainer.Console
 	console libcontainer.Console
 }
 }