Fix restoring of privileged containers

Checkpointed containers started with --privileged fail during restore
with:

 Error: error creating container storage: ProcessLabel and Mountlabel must either not be specified or both specified

This commit fixes it by not setting the labels when restoring a
privileged container.

[NO TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2021-06-10 09:51:57 +00:00 committed by Adrian Reber
parent d116bebdd5
commit d9a1c34e43
No known key found for this signature in database
GPG Key ID: 82C9378ED3C4906A
1 changed files with 1 additions and 1 deletions

View File

@ -427,7 +427,7 @@ func (c *Container) setupStorage(ctx context.Context) error {
},
LabelOpts: c.config.LabelOpts,
}
if c.restoreFromCheckpoint {
if c.restoreFromCheckpoint && !c.config.Privileged {
// If restoring from a checkpoint, the root file-system
// needs to be mounted with the same SELinux labels as
// it was mounted previously.