diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-23 10:06:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 10:06:07 -0400 |
commit | e11d8d4650a4ec50064aab416bebb364ac8ac4bf (patch) | |
tree | f97be30f89dfad417f0a8ac8430389159ea102b0 /pkg/specgen/generate/kube/kube.go | |
parent | 0d2209eb6a8ab8276795db2b3b7e5708754c4054 (diff) | |
parent | 4960a17a56523c0c022992e841262f89312db694 (diff) | |
download | podman-e11d8d4650a4ec50064aab416bebb364ac8ac4bf.tar.gz podman-e11d8d4650a4ec50064aab416bebb364ac8ac4bf.tar.bz2 podman-e11d8d4650a4ec50064aab416bebb364ac8ac4bf.zip |
Merge pull request #14266 from tupyy/add-blockdevice-play-kube
Expose block and character devices with play kube
Diffstat (limited to 'pkg/specgen/generate/kube/kube.go')
-rw-r--r-- | pkg/specgen/generate/kube/kube.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go index e4c149abf..f37d79798 100644 --- a/pkg/specgen/generate/kube/kube.go +++ b/pkg/specgen/generate/kube/kube.go @@ -381,6 +381,22 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener Options: options, } s.Volumes = append(s.Volumes, &cmVolume) + case KubeVolumeTypeCharDevice: + // We are setting the path as hostPath:mountPath to comply with pkg/specgen/generate.DeviceFromPath. + // The type is here just to improve readability as it is not taken into account when the actual device is created. + device := spec.LinuxDevice{ + Path: fmt.Sprintf("%s:%s", volumeSource.Source, volume.MountPath), + Type: "c", + } + s.Devices = append(s.Devices, device) + case KubeVolumeTypeBlockDevice: + // We are setting the path as hostPath:mountPath to comply with pkg/specgen/generate.DeviceFromPath. + // The type is here just to improve readability as it is not taken into account when the actual device is created. + device := spec.LinuxDevice{ + Path: fmt.Sprintf("%s:%s", volumeSource.Source, volume.MountPath), + Type: "b", + } + s.Devices = append(s.Devices, device) default: return nil, errors.Errorf("Unsupported volume source type") } |