mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
Merge pull request #16273 from vrothberg/cidfile
container/pod id file: truncate instead of throwing an error
This commit is contained in:
@ -1120,7 +1120,7 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta
|
||||
}
|
||||
|
||||
if opts.CIDFile != "" {
|
||||
if err := util.CreateCidFile(opts.CIDFile, ctr.ID()); err != nil {
|
||||
if err := util.CreateIDFile(opts.CIDFile, ctr.ID()); err != nil {
|
||||
// If you fail to create CIDFile then remove the container
|
||||
_ = removeContainer(ctr, true)
|
||||
return nil, err
|
||||
|
||||
@ -804,7 +804,7 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta
|
||||
}
|
||||
|
||||
if opts.CIDFile != "" {
|
||||
if err := util.CreateCidFile(opts.CIDFile, con.ID); err != nil {
|
||||
if err := util.CreateIDFile(opts.CIDFile, con.ID); err != nil {
|
||||
// If you fail to create CIDFile then remove the container
|
||||
_ = removeContainer(con.ID, true)
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user