-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for kube yaml files with multi-documents (#724)
* Add support for multi doc kube yaml Signed-off-by: nishipy <goodisonev4@gmail.com> * Update to skip yamllint Signed-off-by: nishipy <goodisonev4@gmail.com> * Update ignores for sanity tests Signed-off-by: nishipy <goodisonev4@gmail.com> * Update discover_pods() Signed-off-by: nishipy <goodisonev4@gmail.com> * Update test for podman_play Signed-off-by: nishipy <goodisonev4@gmail.com> --------- Signed-off-by: nishipy <goodisonev4@gmail.com>
- Loading branch information
Showing
14 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
kind: ConfigMap | ||
metadata: | ||
name: foo | ||
data: | ||
FOO: bar | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: foobar | ||
spec: | ||
containers: | ||
- command: | ||
- top | ||
name: container-1 | ||
image: alpine | ||
envFrom: | ||
- configMapRef: | ||
name: foo | ||
optional: false | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: foo2 | ||
data: | ||
FOO2: bar2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/integration/targets/podman_play/tasks/play-multi-yaml.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
- name: Test kube play wih multi doc yaml | ||
block: | ||
- name: Copy kube file | ||
copy: | ||
src: "{{ kube_file }}" | ||
dest: "{{ kube_dir }}/{{ kube_file }}" | ||
remote_src: false | ||
|
||
- name: Create Pod with multi doc yaml | ||
containers.podman.podman_play: | ||
executable: "{{ test_executable | default('podman') }}" | ||
kube_file: "{{ kube_dir }}/{{ kube_file }}" | ||
state: started | ||
recreate: true | ||
register: play_pod | ||
|
||
- name: Get pod info | ||
containers.podman.podman_container_info: | ||
executable: "{{ test_executable | default('podman') }}" | ||
name: "{{ target_container }}" | ||
register: info | ||
|
||
- name: Check if an expected container is running | ||
assert: | ||
that: | ||
- info.containers.0.State.Running == true | ||
- '"FOO=bar" in info.containers.0.Config.Env' | ||
|
||
- name: Cleanup pod | ||
containers.podman.podman_play: | ||
executable: "{{ test_executable | default('podman') }}" | ||
kube_file: "{{ kube_dir }}/{{ kube_file }}" | ||
state: absent | ||
register: remove_pod | ||
|
||
- name: Check if the pod was removed as expected | ||
assert: | ||
that: | ||
- remove_pod is changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 | ||
tests/integration/targets/podman_play/tasks/files/multi-yaml.yml yamllint!skip |