fix after_create hook
@@ -302,11 +302,18 @@ func (c *Calcium) doDeployOneWorkload(
}
// deal with hook
- if len(opts.AfterCreate) > 0 && workload.Hook != nil {
+ if len(opts.AfterCreate) > 0 {
+ if workload.Hook != nil {
workload.Hook = &types.Hook{
AfterStart: append(opts.AfterCreate, workload.Hook.AfterStart...),
Force: workload.Hook.Force,
}
+ } else {
+ workload.Hook = &types.Hook{
+ AfterStart: opts.AfterCreate,
+ Force: opts.IgnoreHook,
+ }
+ }
}
// start first
