mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix linting errors.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- absent_2 is not changed
|
||||
- absent_2 is not changed
|
||||
|
||||
- name: Make sure image is there
|
||||
docker_image:
|
||||
@@ -44,8 +44,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- present_1 is changed
|
||||
- present_2 is not changed
|
||||
- present_1 is changed
|
||||
- present_2 is not changed
|
||||
|
||||
- name: Make sure tag is not there
|
||||
docker_image:
|
||||
@@ -83,10 +83,10 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- tag_1 is changed
|
||||
- tag_2 is not changed
|
||||
- tag_3 is not changed
|
||||
- tag_4 is not changed
|
||||
- tag_1 is changed
|
||||
- tag_2 is not changed
|
||||
- tag_3 is not changed
|
||||
- tag_4 is not changed
|
||||
|
||||
- name: Cleanup alias tag
|
||||
docker_image:
|
||||
@@ -129,11 +129,11 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- fail_1 is failed
|
||||
- "'`repository` must not be an image ID' in fail_1.msg"
|
||||
- fail_2 is failed
|
||||
- "'Cannot push an image by ID' in fail_2.msg"
|
||||
- fail_3 is failed
|
||||
- "'Image name must not be an image ID for source=pull' in fail_3.msg"
|
||||
- fail_4 is failed
|
||||
- "'Image name must not be an image ID for source=build' in fail_4.msg"
|
||||
- fail_1 is failed
|
||||
- "'`repository` must not be an image ID' in fail_1.msg"
|
||||
- fail_2 is failed
|
||||
- "'Cannot push an image by ID' in fail_2.msg"
|
||||
- fail_3 is failed
|
||||
- "'Image name must not be an image ID for source=pull' in fail_3.msg"
|
||||
- fail_4 is failed
|
||||
- "'Image name must not be an image ID for source=build' in fail_4.msg"
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- push_1 is changed
|
||||
- push_2 is not changed
|
||||
- push_3 is not changed
|
||||
- push_1 is changed
|
||||
- push_2 is not changed
|
||||
- push_3 is not changed
|
||||
|
||||
- name: Get facts of local image
|
||||
docker_image_info:
|
||||
@@ -102,11 +102,11 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- pull_1 is changed
|
||||
- pull_2 is not changed
|
||||
- facts_1.images | length == 1
|
||||
- facts_2.images | length == 0
|
||||
- facts_3.images | length == 1
|
||||
- pull_1 is changed
|
||||
- pull_2 is not changed
|
||||
- facts_1.images | length == 1
|
||||
- facts_2.images | length == 0
|
||||
- facts_3.images | length == 1
|
||||
|
||||
- name: Pull image from test registry (with digest)
|
||||
docker_image:
|
||||
@@ -148,8 +148,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- push_1_different is changed
|
||||
- push_2_different is not changed
|
||||
- push_1_different is changed
|
||||
- push_2_different is not changed
|
||||
|
||||
- name: Tag same image with new tag
|
||||
docker_image:
|
||||
@@ -178,24 +178,24 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
# NOTE: This should be:
|
||||
# - push_1_same is changed
|
||||
# Unfortunately docker does *NOT* report whether the tag already existed or not.
|
||||
# Here are the logs returned by client.push() for both tasks (which are exactly the same):
|
||||
# push_1_same:
|
||||
# {"status": "The push refers to repository [localhost:32796/test/hello-world]"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Preparing"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Layer already exists"},
|
||||
# {"status": "newtag2: digest: sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b size: 528"},
|
||||
# {"aux": {"Digest": "sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b", "Size": 528, "Tag": "newtag2"}, "progressDetail": {}}
|
||||
# push_2_same:
|
||||
# {"status": "The push refers to repository [localhost:32796/test/hello-world]"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Preparing"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Layer already exists"},
|
||||
# {"status": "newtag2: digest: sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b size: 528"},
|
||||
# {"aux": {"Digest": "sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b", "Size": 528, "Tag": "newtag2"}, "progressDetail": {}}
|
||||
- push_1_same is not changed
|
||||
- push_2_same is not changed
|
||||
# NOTE: This should be:
|
||||
# - push_1_same is changed
|
||||
# Unfortunately docker does *NOT* report whether the tag already existed or not.
|
||||
# Here are the logs returned by client.push() for both tasks (which are exactly the same):
|
||||
# push_1_same:
|
||||
# {"status": "The push refers to repository [localhost:32796/test/hello-world]"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Preparing"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Layer already exists"},
|
||||
# {"status": "newtag2: digest: sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b size: 528"},
|
||||
# {"aux": {"Digest": "sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b", "Size": 528, "Tag": "newtag2"}, "progressDetail": {}}
|
||||
# push_2_same:
|
||||
# {"status": "The push refers to repository [localhost:32796/test/hello-world]"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Preparing"},
|
||||
# {"id": "3fc64803ca2d", "progressDetail": {}, "status": "Layer already exists"},
|
||||
# {"status": "newtag2: digest: sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b size: 528"},
|
||||
# {"aux": {"Digest": "sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b", "Size": 528, "Tag": "newtag2"}, "progressDetail": {}}
|
||||
- push_1_same is not changed
|
||||
- push_2_same is not changed
|
||||
|
||||
####################################################################
|
||||
## repository ######################################################
|
||||
@@ -241,10 +241,10 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- repository_1 is changed
|
||||
- repository_2 is not changed
|
||||
- repository_3 is changed
|
||||
- repository_4 is not changed
|
||||
- repository_1 is changed
|
||||
- repository_2 is not changed
|
||||
- repository_3 is changed
|
||||
- repository_4 is not changed
|
||||
|
||||
- name: Get facts of image
|
||||
docker_image_info:
|
||||
@@ -259,4 +259,4 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- facts_1.images | length == 1
|
||||
- facts_1.images | length == 1
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- buildargs_1 is changed
|
||||
- buildargs_2 is not failed and buildargs_2 is not changed
|
||||
- buildargs_1 is changed
|
||||
- buildargs_2 is not failed and buildargs_2 is not changed
|
||||
|
||||
####################################################################
|
||||
## build.container_limits ##########################################
|
||||
@@ -102,14 +102,14 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
# It *sometimes* happens that the first task does not fail.
|
||||
# For now, we work around this by
|
||||
# a) requiring that if it fails, the message must
|
||||
# contain 'Minimum memory limit allowed is (4|6)MB', and
|
||||
# b) requiring that either the first task, or the second
|
||||
# task is changed, but not both.
|
||||
- "not container_limits_1 is failed or ('Minimum memory limit allowed is ') in container_limits_1.msg"
|
||||
- "container_limits_1 is changed or container_limits_2 is changed and not (container_limits_1 is changed and container_limits_2 is changed)"
|
||||
# It *sometimes* happens that the first task does not fail.
|
||||
# For now, we work around this by
|
||||
# a) requiring that if it fails, the message must
|
||||
# contain 'Minimum memory limit allowed is (4|6)MB', and
|
||||
# b) requiring that either the first task, or the second
|
||||
# task is changed, but not both.
|
||||
- "not container_limits_1 is failed or ('Minimum memory limit allowed is ') in container_limits_1.msg"
|
||||
- "container_limits_1 is changed or container_limits_2 is changed and not (container_limits_1 is changed and container_limits_2 is changed)"
|
||||
|
||||
####################################################################
|
||||
## build.dockerfile ################################################
|
||||
@@ -133,9 +133,9 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- dockerfile_1 is changed
|
||||
- "('FROM ' ~ docker_test_image_alpine) in dockerfile_1.stdout"
|
||||
- dockerfile_1['image']['Config']['WorkingDir'] == '/newdata'
|
||||
- dockerfile_1 is changed
|
||||
- "('FROM ' ~ docker_test_image_alpine) in dockerfile_1.stdout"
|
||||
- dockerfile_1['image']['Config']['WorkingDir'] == '/newdata'
|
||||
|
||||
####################################################################
|
||||
## build.platform ##################################################
|
||||
@@ -177,8 +177,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- platform_1 is changed
|
||||
- platform_2 is not failed and platform_2 is not changed
|
||||
- platform_1 is changed
|
||||
- platform_2 is not failed and platform_2 is not changed
|
||||
|
||||
####################################################################
|
||||
## force ###########################################################
|
||||
@@ -222,8 +222,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- force_1 is changed
|
||||
- force_2 is not changed
|
||||
- force_1 is changed
|
||||
- force_2 is not changed
|
||||
|
||||
####################################################################
|
||||
## load path #######################################################
|
||||
@@ -350,15 +350,15 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- load_image is changed
|
||||
- archive_image['image']['Id'] == load_image['image']['Id']
|
||||
- load_image_1 is not changed
|
||||
- load_image_2 is failed
|
||||
- >-
|
||||
("The archive did not contain image 'foo:bar'. Instead, found '" ~ docker_test_image_hello_world ~ "'.") == load_image_2.msg
|
||||
- load_image_3 is failed
|
||||
- '"Detected no loaded images. Archive potentially corrupt?" == load_image_3.msg'
|
||||
- load_image_4 is not changed
|
||||
- load_image is changed
|
||||
- archive_image['image']['Id'] == load_image['image']['Id']
|
||||
- load_image_1 is not changed
|
||||
- load_image_2 is failed
|
||||
- >-
|
||||
("The archive did not contain image 'foo:bar'. Instead, found '" ~ docker_test_image_hello_world ~ "'.") == load_image_2.msg
|
||||
- load_image_3 is failed
|
||||
- '"Detected no loaded images. Archive potentially corrupt?" == load_image_3.msg'
|
||||
- load_image_4 is not changed
|
||||
|
||||
####################################################################
|
||||
## build.path ######################################################
|
||||
@@ -416,8 +416,8 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- dockerfile_2 is changed
|
||||
- dockerfile_2.image.Config.WorkingDir == '/first'
|
||||
- dockerfile_2 is changed
|
||||
- dockerfile_2.image.Config.WorkingDir == '/first'
|
||||
|
||||
####################################################################
|
||||
## build.etc_hosts #################################################
|
||||
|
||||
Reference in New Issue
Block a user