diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-13 13:09:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 13:09:07 +0100 |
commit | d6ba8b4110907d8ce92142078f443311bbe74c58 (patch) | |
tree | e7bfb031709ba3550dfae02f31bdce721b027bd0 /pkg | |
parent | 2814995a9281b3b8e67d7c48df28de0de742b995 (diff) | |
parent | 5418c9c06b077e206f1ae837c4b395539059ebd7 (diff) | |
download | podman-d6ba8b4110907d8ce92142078f443311bbe74c58.tar.gz podman-d6ba8b4110907d8ce92142078f443311bbe74c58.tar.bz2 podman-d6ba8b4110907d8ce92142078f443311bbe74c58.zip |
Merge pull request #5177 from rhatdan/kube
Fix up play kube to use image data
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/adapter/pods.go | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go index b0e63f770..a30ec6649 100644 --- a/pkg/adapter/pods.go +++ b/pkg/adapter/pods.go @@ -764,7 +764,6 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.ImageID = newImage.ID() containerConfig.Name = containerYAML.Name containerConfig.Tty = containerYAML.TTY - containerConfig.WorkDir = containerYAML.WorkingDir containerConfig.Pod = podID @@ -796,6 +795,27 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.StopSignal = 15 + containerConfig.WorkDir = "/" + if imageData != nil { + // FIXME, + // we are currently ignoring imageData.Config.ExposedPorts + containerConfig.BuiltinImgVolumes = imageData.Config.Volumes + if imageData.Config.WorkingDir != "" { + containerConfig.WorkDir = imageData.Config.WorkingDir + } + containerConfig.Labels = imageData.Config.Labels + if imageData.Config.StopSignal != "" { + stopSignal, err := util.ParseSignal(imageData.Config.StopSignal) + if err != nil { + return nil, err + } + containerConfig.StopSignal = stopSignal + } + } + + if containerYAML.WorkingDir != "" { + containerConfig.WorkDir = containerYAML.WorkingDir + } // If the user does not pass in ID mappings, just set to basics if userConfig.IDMappings == nil { userConfig.IDMappings = &storage.IDMappingOptions{} |