summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-09 16:19:59 -0500
committerGitHub <noreply@github.com>2022-03-09 16:19:59 -0500
commitacfcecf2ae41528d1d7ecd43d37d8fd554f587bc (patch)
treeb92171a480a5d4d155f311a5e0a815efb4330ddc /pkg
parent4e21acd7b81865300266c9e9916a49454d72a6c7 (diff)
parent675d775eb54f1614a542dfcbbc5a4aa857cc0db0 (diff)
downloadpodman-acfcecf2ae41528d1d7ecd43d37d8fd554f587bc.tar.gz
podman-acfcecf2ae41528d1d7ecd43d37d8fd554f587bc.tar.bz2
podman-acfcecf2ae41528d1d7ecd43d37d8fd554f587bc.zip
Merge pull request #12913 from rhatdan/kube
Add --context-dir option to podman play kube
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/entities/play.go2
-rw-r--r--pkg/domain/infra/abi/play.go12
2 files changed, 11 insertions, 3 deletions
diff --git a/pkg/domain/entities/play.go b/pkg/domain/entities/play.go
index 43fa3a712..7614a4012 100644
--- a/pkg/domain/entities/play.go
+++ b/pkg/domain/entities/play.go
@@ -14,6 +14,8 @@ type PlayKubeOptions struct {
Build types.OptionalBool
// CertDir - to a directory containing TLS certifications and keys.
CertDir string
+ // ContextDir - directory containing image contexts used for Build
+ ContextDir string
// Down indicates whether to bring contents of a yaml file "down"
// as in stop
Down bool
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index e72584207..155b06105 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -354,9 +354,15 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
containers := make([]*libpod.Container, 0, len(podYAML.Spec.Containers))
initContainers := make([]*libpod.Container, 0, len(podYAML.Spec.InitContainers))
- cwd, err := os.Getwd()
- if err != nil {
- return nil, err
+
+ var cwd string
+ if options.ContextDir != "" {
+ cwd = options.ContextDir
+ } else {
+ cwd, err = os.Getwd()
+ if err != nil {
+ return nil, err
+ }
}
ctrNames := make(map[string]string)