mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)
* Remove deprecated features in docker_container. * Bump collection version to 3.0.0. * Remove 'published_ports: all' tests.
This commit is contained in:
@@ -53,111 +53,6 @@
|
||||
- published_ports_3 is failed
|
||||
- "published_ports_3.msg == 'Bind addresses for published ports must be IPv4 or IPv6 addresses, not hostnames. Use the dig lookup to resolve hostnames. (Found hostname: foo)'"
|
||||
|
||||
####################################################################
|
||||
## published_ports: all ############################################
|
||||
####################################################################
|
||||
|
||||
- name: published_ports -- all
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
published_ports:
|
||||
- all
|
||||
force_kill: yes
|
||||
register: published_ports_1
|
||||
|
||||
- name: published_ports -- all (idempotency)
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
published_ports:
|
||||
- all
|
||||
force_kill: yes
|
||||
register: published_ports_2
|
||||
|
||||
- name: published_ports -- all (writing out 'all')
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
published_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
force_kill: yes
|
||||
register: published_ports_3
|
||||
|
||||
- name: published_ports -- all (idempotency 2)
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
published_ports:
|
||||
- "9002"
|
||||
- "9001"
|
||||
force_kill: yes
|
||||
register: published_ports_4
|
||||
|
||||
- name: published_ports -- all (switching back to 'all')
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
published_ports:
|
||||
- all
|
||||
force_kill: yes
|
||||
register: published_ports_5
|
||||
|
||||
- name: published_ports -- all equivalence with publish_all_ports
|
||||
docker_container:
|
||||
image: "{{ docker_test_image_alpine }}"
|
||||
command: '/bin/sh -c "sleep 10m"'
|
||||
name: "{{ cname }}"
|
||||
state: started
|
||||
exposed_ports:
|
||||
- "9001"
|
||||
- "9002"
|
||||
publish_all_ports: true
|
||||
force_kill: yes
|
||||
register: published_ports_6
|
||||
|
||||
- name: cleanup
|
||||
docker_container:
|
||||
name: "{{ cname }}"
|
||||
state: absent
|
||||
force_kill: yes
|
||||
diff: no
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- published_ports_1 is changed
|
||||
- published_ports_2 is not changed
|
||||
- published_ports_3 is changed
|
||||
- published_ports_4 is not changed
|
||||
- published_ports_5 is changed
|
||||
- published_ports_6 is not changed
|
||||
|
||||
####################################################################
|
||||
## published_ports: port range #####################################
|
||||
####################################################################
|
||||
@@ -424,4 +319,4 @@
|
||||
loop: "{{ publish_all_ports_test_cases }}"
|
||||
loop_control:
|
||||
index_var: index
|
||||
loop_var: test_case
|
||||
loop_var: test_case
|
||||
|
||||
Reference in New Issue
Block a user