Browse Source

error out if checkpoint specified on non-experimental

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Brian Goff 8 năm trước cách đây
mục cha
commit
3c0a2bb289
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      daemon/start.go

+ 4 - 0
daemon/start.go

@@ -20,6 +20,10 @@ import (
 
 // ContainerStart starts a container.
 func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.HostConfig, validateHostname bool, checkpoint string) error {
+	if checkpoint != "" && !daemon.HasExperimental() {
+		return errors.NewBadRequestError(fmt.Errorf("checkpoint is only supported in experimental mode"))
+	}
+
 	container, err := daemon.GetContainer(name)
 	if err != nil {
 		return err