diff options
author | Peter Hunt <pehunt@redhat.com> | 2020-08-28 17:18:01 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2020-08-28 17:18:03 -0400 |
commit | 83531904da6e3fbf1593ca3c77b14058e8707a58 (patch) | |
tree | 66a90ea4f3ebf60e9420724ee2ed38da2fd0c491 /pkg/domain/infra/abi | |
parent | c069e0bad9f4aa8da98c46d702f450ce41da6346 (diff) | |
download | podman-83531904da6e3fbf1593ca3c77b14058e8707a58.tar.gz podman-83531904da6e3fbf1593ca3c77b14058e8707a58.tar.bz2 podman-83531904da6e3fbf1593ca3c77b14058e8707a58.zip |
play kube: handle Socket HostPath type
as well as add test cases for it and the other HostPath types we currently support
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 4ebc37cda..729cd143c 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -250,13 +250,22 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY if err := libpod.LabelVolumePath(hostPath.Path); err != nil { return nil, errors.Wrapf(err, "Error giving %s a label", hostPath.Path) } + case v1.HostPathSocket: + st, err := os.Stat(hostPath.Path) + if err != nil { + return nil, errors.Wrapf(err, "Error checking HostPathSocket") + } + if st.Mode()&os.ModeSocket != os.ModeSocket { + return nil, errors.Errorf("Error checking HostPathSocket: path %s is not a socket", hostPath.Path) + } + case v1.HostPathDirectory: case v1.HostPathFile: case v1.HostPathUnset: // do nothing here because we will verify the path exists in validateVolumeHostDir break default: - return nil, errors.Errorf("Directories are the only supported HostPath type") + return nil, errors.Errorf("Invalid HostPath type %v", hostPath.Type) } } |