mirror of
https://github.com/containers/podman.git
synced 2025-06-22 09:58:10 +08:00
Fix handling of selinux labels in podman play kube
Fixes: https://github.com/containers/podman/issues/10969 [NO TESTS NEEDED] We added tests for this, but they don't seem to be running. If I run the local system tests, they fail with the current Podman and work with this version. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -276,10 +276,11 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
volume.MountPath = dest
|
||||||
switch volumeSource.Type {
|
switch volumeSource.Type {
|
||||||
case KubeVolumeTypeBindMount:
|
case KubeVolumeTypeBindMount:
|
||||||
mount := spec.Mount{
|
mount := spec.Mount{
|
||||||
Destination: dest,
|
Destination: volume.MountPath,
|
||||||
Source: volumeSource.Source,
|
Source: volumeSource.Source,
|
||||||
Type: "bind",
|
Type: "bind",
|
||||||
Options: options,
|
Options: options,
|
||||||
@ -287,7 +288,7 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
|
|||||||
s.Mounts = append(s.Mounts, mount)
|
s.Mounts = append(s.Mounts, mount)
|
||||||
case KubeVolumeTypeNamed:
|
case KubeVolumeTypeNamed:
|
||||||
namedVolume := specgen.NamedVolume{
|
namedVolume := specgen.NamedVolume{
|
||||||
Dest: dest,
|
Dest: volume.MountPath,
|
||||||
Name: volumeSource.Source,
|
Name: volumeSource.Source,
|
||||||
Options: options,
|
Options: options,
|
||||||
}
|
}
|
||||||
@ -330,12 +331,16 @@ func parseMountPath(mountPath string, readOnly bool) (string, []string, error) {
|
|||||||
options = strings.Split(splitVol[1], ",")
|
options = strings.Split(splitVol[1], ",")
|
||||||
}
|
}
|
||||||
if err := parse.ValidateVolumeCtrDir(dest); err != nil {
|
if err := parse.ValidateVolumeCtrDir(dest); err != nil {
|
||||||
return "", options, errors.Wrapf(err, "error in parsing MountPath")
|
return "", options, errors.Wrapf(err, "parsing MountPath")
|
||||||
}
|
}
|
||||||
if readOnly {
|
if readOnly {
|
||||||
options = append(options, "ro")
|
options = append(options, "ro")
|
||||||
}
|
}
|
||||||
return dest, options, nil
|
opts, err := parse.ValidateVolumeOpts(options)
|
||||||
|
if err != nil {
|
||||||
|
return "", opts, errors.Wrapf(err, "parsing MountOptions")
|
||||||
|
}
|
||||||
|
return dest, opts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupLivenessProbe(s *specgen.SpecGenerator, containerYAML v1.Container, restartPolicy string) error {
|
func setupLivenessProbe(s *specgen.SpecGenerator, containerYAML v1.Container, restartPolicy string) error {
|
||||||
|
Reference in New Issue
Block a user