mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-08 09:55:42 +00:00
With the advent of Podman 2.0.0 we crossed the magical barrier of go modules. While we were able to continue importing all packages inside of the project, the project could not be vendored anymore from the outside. Move the go module to new major version and change all imports to github.com/containers/libpod/v2. The renaming of the imports was done via gomove [1]. [1] https://github.com/KSubedi/gomove Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
30 lines
779 B
Go
30 lines
779 B
Go
package common
|
|
|
|
import (
|
|
"github.com/containers/libpod/v2/pkg/util"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// validate determines if the flags and values given by the user are valid. things checked
|
|
// by validate must not need any state information on the flag (i.e. changed)
|
|
func (c *ContainerCLIOpts) validate() error {
|
|
var ()
|
|
if c.Rm && c.Restart != "" && c.Restart != "no" {
|
|
return errors.Errorf("the --rm option conflicts with --restart")
|
|
}
|
|
|
|
if _, err := util.ValidatePullType(c.Pull); err != nil {
|
|
return err
|
|
}
|
|
|
|
var imageVolType = map[string]string{
|
|
"bind": "",
|
|
"tmpfs": "",
|
|
"ignore": "",
|
|
}
|
|
if _, ok := imageVolType[c.ImageVolume]; !ok {
|
|
return errors.Errorf("invalid image-volume type %q. Pick one of bind, tmpfs, or ignore", c.ImageVolume)
|
|
}
|
|
return nil
|
|
|
|
}
|