فهرست منبع

Restore compose v1 behavior to recreate containers when ran with -V

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 1 سال پیش
والد
کامیت
a7424435b3
2فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 3 0
      cmd/compose/create.go
  2. 3 0
      cmd/compose/up.go

+ 3 - 0
cmd/compose/create.go

@@ -117,6 +117,9 @@ func (opts createOptions) recreateStrategy() string {
 	if opts.forceRecreate {
 		return api.RecreateForce
 	}
+	if opts.noInherit {
+		return api.RecreateForce
+	}
 	return api.RecreateDiverged
 }
 

+ 3 - 0
cmd/compose/up.go

@@ -189,6 +189,9 @@ func validateFlags(up *upOptions, create *createOptions) error {
 	if up.Detach && (up.attachDependencies || up.cascadeStop || up.cascadeFail || len(up.attach) > 0 || up.watch) {
 		return fmt.Errorf("--detach cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach, --attach-dependencies or --watch")
 	}
+	if create.noInherit && create.noRecreate {
+		return fmt.Errorf("--no-recreate and --renew-anon-volumes are incompatible")
+	}
 	if create.forceRecreate && create.noRecreate {
 		return fmt.Errorf("--force-recreate and --no-recreate are incompatible")
 	}