mirror of
https://github.com/containers/podman.git
synced 2025-12-04 12:17:34 +08:00
Bump Buildah to v1.8.1, ImageBuilder to v1.1.0
As the title suggests. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
4
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
4
vendor/github.com/containers/buildah/pkg/cli/common.go
generated
vendored
@@ -96,7 +96,7 @@ type FromAndBudResults struct {
|
||||
SecurityOpt []string
|
||||
ShmSize string
|
||||
Ulimit []string
|
||||
Volume []string
|
||||
Volumes []string
|
||||
}
|
||||
|
||||
// GetUserNSFlags returns the common flags for usernamespace
|
||||
@@ -190,7 +190,7 @@ func GetFromAndBudFlags(flags *FromAndBudResults, usernsResults *UserNSResults,
|
||||
fs.StringArrayVar(&flags.SecurityOpt, "security-opt", []string{}, "security options (default [])")
|
||||
fs.StringVar(&flags.ShmSize, "shm-size", "65536k", "size of '/dev/shm'. The format is `<number><unit>`.")
|
||||
fs.StringSliceVar(&flags.Ulimit, "ulimit", []string{}, "ulimit options (default [])")
|
||||
fs.StringSliceVarP(&flags.Volume, "volume", "v", []string{}, "bind mount a volume into the container (default [])")
|
||||
fs.StringSliceVarP(&flags.Volumes, "volume", "v", []string{}, "bind mount a volume into the container (default [])")
|
||||
|
||||
// Add in the usernamespace and namespaceflags
|
||||
usernsFlags := GetUserNSFlags(usernsResults)
|
||||
|
||||
41
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
41
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@@ -149,27 +149,42 @@ func parseSecurityOpts(securityOpts []string, commonOpts *buildah.CommonBuildOpt
|
||||
return nil
|
||||
}
|
||||
|
||||
func ParseVolume(volume string) (specs.Mount, error) {
|
||||
mount := specs.Mount{}
|
||||
arr := strings.SplitN(volume, ":", 3)
|
||||
if len(arr) < 2 {
|
||||
return mount, errors.Errorf("incorrect volume format %q, should be host-dir:ctr-dir[:option]", volume)
|
||||
}
|
||||
if err := validateVolumeHostDir(arr[0]); err != nil {
|
||||
return mount, err
|
||||
}
|
||||
if err := validateVolumeCtrDir(arr[1]); err != nil {
|
||||
return mount, err
|
||||
}
|
||||
mountOptions := ""
|
||||
if len(arr) > 2 {
|
||||
mountOptions = arr[2]
|
||||
if err := validateVolumeOpts(arr[2]); err != nil {
|
||||
return mount, err
|
||||
}
|
||||
}
|
||||
mountOpts := strings.Split(mountOptions, ",")
|
||||
mount.Source = arr[0]
|
||||
mount.Destination = arr[1]
|
||||
mount.Type = "rbind"
|
||||
mount.Options = mountOpts
|
||||
return mount, nil
|
||||
}
|
||||
|
||||
// ParseVolumes validates the host and container paths passed in to the --volume flag
|
||||
func ParseVolumes(volumes []string) error {
|
||||
if len(volumes) == 0 {
|
||||
return nil
|
||||
}
|
||||
for _, volume := range volumes {
|
||||
arr := strings.SplitN(volume, ":", 3)
|
||||
if len(arr) < 2 {
|
||||
return errors.Errorf("incorrect volume format %q, should be host-dir:ctr-dir[:option]", volume)
|
||||
}
|
||||
if err := validateVolumeHostDir(arr[0]); err != nil {
|
||||
if _, err := ParseVolume(volume); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateVolumeCtrDir(arr[1]); err != nil {
|
||||
return err
|
||||
}
|
||||
if len(arr) > 2 {
|
||||
if err := validateVolumeOpts(arr[2]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user