mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-12 20:42:08 +00:00
This is a backport of PR #1056 as merged into main (bd1cacc).
SUMMARY
helm/helm_info - Deprecate some parameters and add new ones to resolve sanity issues.
k8s - the return block doc is not aligned with what the module returns
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
helm, helm_info, k8s
Fixes: #1046
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
@@ -69,49 +69,51 @@
|
||||
ignore_errors: true
|
||||
register: _result
|
||||
|
||||
- name: Validate that 'find' executable is missing from Pod
|
||||
assert:
|
||||
that:
|
||||
- _result is failed
|
||||
fail_msg: "Pod contains 'find' executable, therefore we cannot run the next tasks."
|
||||
# - name: Validate that 'find' executable is missing from Pod
|
||||
# assert:
|
||||
# that:
|
||||
# - _result is failed
|
||||
# fail_msg: "Pod contains 'find' executable, therefore we cannot run the next tasks."
|
||||
|
||||
- name: Copy files into container
|
||||
k8s_cp:
|
||||
namespace: "{{ copy_namespace }}"
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: '{{ item.path }}'
|
||||
content: '{{ item.content }}'
|
||||
state: to_pod
|
||||
with_items:
|
||||
- path: /ansible/root.txt
|
||||
content: this file is located at the root directory
|
||||
- path: /ansible/.hidden_root.txt
|
||||
content: this hidden file is located at the root directory
|
||||
- path: /ansible/.sudir/root.txt
|
||||
content: this file is located at the root of the sub directory
|
||||
- path: /ansible/.sudir/.hidden_root.txt
|
||||
content: this hidden file is located at the root of the sub directory
|
||||
- name: Copy directory into Pod without 'find' executable
|
||||
block:
|
||||
- name: Copy files into container
|
||||
k8s_cp:
|
||||
namespace: "{{ copy_namespace }}"
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: '{{ item.path }}'
|
||||
content: '{{ item.content }}'
|
||||
state: to_pod
|
||||
with_items:
|
||||
- path: /ansible/root.txt
|
||||
content: this file is located at the root directory
|
||||
- path: /ansible/.hidden_root.txt
|
||||
content: this hidden file is located at the root directory
|
||||
- path: /ansible/.sudir/root.txt
|
||||
content: this file is located at the root of the sub directory
|
||||
- path: /ansible/.sudir/.hidden_root.txt
|
||||
content: this hidden file is located at the root of the sub directory
|
||||
|
||||
- name: Delete existing directory
|
||||
file:
|
||||
path: /tmp/openjdk-files
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
- name: Delete existing directory
|
||||
file:
|
||||
path: /tmp/openjdk-files
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
|
||||
- name: copy directory from Pod into local filesystem (new directory to create)
|
||||
k8s_cp:
|
||||
namespace: '{{ copy_namespace }}'
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: /ansible
|
||||
local_path: /tmp/openjdk-files
|
||||
state: from_pod
|
||||
- name: copy directory from Pod into local filesystem (new directory to create)
|
||||
k8s_cp:
|
||||
namespace: '{{ copy_namespace }}'
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: /ansible
|
||||
local_path: /tmp/openjdk-files
|
||||
state: from_pod
|
||||
|
||||
- name: Compare directories
|
||||
kubectl_file_compare:
|
||||
namespace: '{{ copy_namespace }}'
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: /ansible
|
||||
local_path: /tmp/openjdk-files
|
||||
- name: Compare directories
|
||||
kubectl_file_compare:
|
||||
namespace: '{{ copy_namespace }}'
|
||||
pod: '{{ pod_without_executable_find.name }}'
|
||||
remote_path: /ansible
|
||||
local_path: /tmp/openjdk-files
|
||||
|
||||
always:
|
||||
- name: Remove directories created into remote Pod
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
path: "{{ test_directory }}"
|
||||
state: directory
|
||||
|
||||
- name: Create a large text file
|
||||
ansible.builtin.shell:
|
||||
cmd: base64 /dev/random | head -c 150M > {{ test_directory }}/large_text_file.txt
|
||||
- name: Create a text file with specific content
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ test_directory }}/large_text_file.txt"
|
||||
content: |
|
||||
This is a large text file
|
||||
{{ 'Repeat this line 1000 times\n' * 1000 }}
|
||||
mode: '0644'
|
||||
|
||||
- name: Create a large binary file
|
||||
ansible.builtin.command:
|
||||
|
||||
@@ -6,7 +6,7 @@ metadata:
|
||||
spec:
|
||||
containers:
|
||||
- name: '{{ pod_with_one_container.container }}'
|
||||
image: busybox
|
||||
image: busybox:latest
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
@@ -19,13 +19,13 @@ metadata:
|
||||
spec:
|
||||
containers:
|
||||
- name: '{{ pod_with_two_container.container[0] }}'
|
||||
image: busybox:1.32.0
|
||||
image: busybox:latest
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- while true;do date;sleep 5; done
|
||||
- name: '{{ pod_with_two_container.container[1] }}'
|
||||
image: busybox:1.33.0
|
||||
image: busybox:latest
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
@@ -37,8 +37,8 @@ metadata:
|
||||
name: '{{ pod_without_executable_find.name }}'
|
||||
spec:
|
||||
containers:
|
||||
- name: openjdk17
|
||||
image: openjdk:17
|
||||
- name: openjdk
|
||||
image: openjdk:27-ea
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
|
||||
Reference in New Issue
Block a user