Skip to content

Commit

Permalink
Merge pull request #10992 from rhatdan/play
Browse files Browse the repository at this point in the history
Fix handling of selinux labels in podman play kube
  • Loading branch information
openshift-merge-robot authored Jul 21, 2021
2 parents 7826343 + 117850e commit e3816dd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/specgen/generate/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,19 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
return nil, err
}

volume.MountPath = dest
switch volumeSource.Type {
case KubeVolumeTypeBindMount:
mount := spec.Mount{
Destination: dest,
Destination: volume.MountPath,
Source: volumeSource.Source,
Type: "bind",
Options: options,
}
s.Mounts = append(s.Mounts, mount)
case KubeVolumeTypeNamed:
namedVolume := specgen.NamedVolume{
Dest: dest,
Dest: volume.MountPath,
Name: volumeSource.Source,
Options: options,
}
Expand Down Expand Up @@ -330,12 +331,16 @@ func parseMountPath(mountPath string, readOnly bool) (string, []string, error) {
options = strings.Split(splitVol[1], ",")
}
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 {
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 {
Expand Down

0 comments on commit e3816dd

Please sign in to comment.