diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-31 09:36:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 09:36:04 -0400 |
commit | 8266dbe7a90f6f03995b42315b3ac2da54cd018f (patch) | |
tree | de047861dc6efaaf66ce626ccd57501b0eccbb08 /libpod/runtime_ctr.go | |
parent | 60e4b762b3c6eef38e3f2d635011bbeafa157ba1 (diff) | |
parent | 98169c20ddc09d8fa14d556e93cad3259b5ccca9 (diff) | |
download | podman-8266dbe7a90f6f03995b42315b3ac2da54cd018f.tar.gz podman-8266dbe7a90f6f03995b42315b3ac2da54cd018f.tar.bz2 podman-8266dbe7a90f6f03995b42315b3ac2da54cd018f.zip |
Merge pull request #15473 from umohnani8/empty-dir
Add emptyDir volume support to kube play
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 703ae5cbe..b43114fab 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -474,6 +474,11 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai return nil, fmt.Errorf("error retrieving named volume %s for new container: %w", vol.Name, err) } } + if vol.IsAnonymous { + // If SetAnonymous is true, make this an anonymous volume + // this is needed for emptyDir volumes from kube yamls + isAnonymous = true + } logrus.Debugf("Creating new volume %s for container", vol.Name) @@ -814,11 +819,11 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo // Ignore error, since podman will report original error volumesFrom, _ := c.volumesFrom() if len(volumesFrom) > 0 { - logrus.Debugf("Cleaning up volume not possible since volume is in use (%s)", v) + logrus.Debugf("Cleaning up volume not possible since volume is in use (%s)", v.Name) continue } } - logrus.Errorf("Cleaning up volume (%s): %v", v, err) + logrus.Errorf("Cleaning up volume (%s): %v", v.Name, err) } } } @@ -968,7 +973,7 @@ func (r *Runtime) evictContainer(ctx context.Context, idOrName string, removeVol continue } if err := r.removeVolume(ctx, volume, false, timeout, false); err != nil && err != define.ErrNoSuchVolume && err != define.ErrVolumeBeingUsed { - logrus.Errorf("Cleaning up volume (%s): %v", v, err) + logrus.Errorf("Cleaning up volume (%s): %v", v.Name, err) } } } |