Skip to content

Commit

Permalink
Add --context-dir option to podman play kube
Browse files Browse the repository at this point in the history
This option was requested so that users could specify alternate
locations to find context directories for each image build. It
requites the --build option to be set.

Partion Fix: containers#12485

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com>
  • Loading branch information
rhatdan authored and kbaran1998 committed Mar 24, 2022
1 parent 2c83838 commit ff6c445
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
12 changes: 9 additions & 3 deletions pkg/domain/infra/abi/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions test/system/700-play.bats
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,3 @@ _EOF
run_podman pod rm -t 0 -f test_pod
run_podman rmi -f userimage:latest
}

@test "podman play --annotation" {
TESTDIR=$PODMAN_TMPDIR/testdir
RANDOMSTRING=$(random_string 15)
mkdir -p $TESTDIR
echo "$testYaml" | sed "s|TESTDIR|${TESTDIR}|g" > $PODMAN_TMPDIR/test.yaml
run_podman play kube --annotation "name=$RANDOMSTRING" $PODMAN_TMPDIR/test.yaml
run_podman inspect --format "{{ .Config.Annotations }}" test_pod-test
is "$output" ".*name:$RANDOMSTRING" "Annotation should be added to pod"

run_podman stop -a -t 0
run_podman pod rm -t 0 -f test_pod
}

0 comments on commit ff6c445

Please sign in to comment.