Merge pull request #2002 from darfux/prevent_killing_cntr_with_failed_exec

v2: Prevent killing all container processes when exec is failed
This commit is contained in:
Eric Ernst 2019-08-25 13:59:54 +08:00 committed by GitHub
commit e7c785ed19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -675,6 +675,14 @@ func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (_ *ptypes.E
return nil, err
}
processID = execs.id
if processID == "" {
logrus.WithFields(logrus.Fields{
"sandbox": s.sandbox.ID(),
"Container": c.id,
"ExecID": r.ExecID,
}).Debug("Id of exec process to be signalled is empty")
return empty, errors.New("The exec process does not exist")
}
}
return empty, s.sandbox.SignalProcess(c.id, processID, signum, r.All)