Explorar o código

Merge pull request #16240 from Microsoft/10662-stopsignal

Windows: Nice error on stopsignal
Jess Frazelle %!s(int64=9) %!d(string=hai) anos
pai
achega
ec6d91ce43
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 3 0
      builder/dispatchers.go
  2. 1 1
      builder/evaluator.go

+ 3 - 0
builder/dispatchers.go

@@ -540,6 +540,9 @@ func volume(b *builder, args []string, attributes map[string]bool, original stri
 //
 // Set the signal that will be used to kill the container.
 func stopSignal(b *builder, args []string, attributes map[string]bool, original string) error {
+	if runtime.GOOS == "windows" {
+		return fmt.Errorf("STOPSIGNAL is not supported on Windows")
+	}
 	if len(args) != 1 {
 		return fmt.Errorf("STOPSIGNAL requires exactly one argument")
 	}

+ 1 - 1
builder/evaluator.go

@@ -367,7 +367,7 @@ func platformSupports(command string) error {
 		return nil
 	}
 	switch command {
-	case "expose", "volume", "user":
+	case "expose", "volume", "user", "stopsignal":
 		return fmt.Errorf("The daemon on this platform does not support the command '%s'", command)
 	}
 	return nil