-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
centos will likely fail because of projectatomic/docker#285 |
- name: Remove specified image | ||
command: atomic --debug --assumeyes images delete {{ image }} | ||
- name: Remove {{ aid_image }} | ||
command: atomic --assumeyes images delete {{ aid_image }} {{ del_options }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no newline at the end of the file (GitHub actually highlights this in the diff!)
tests/atomic/main.yml
Outdated
|
||
- name: Set cockpit container name for Fedora/CentOS | ||
set_fact: | ||
cockpit_cname: "registry.fedoraproject.org/f25/cockpit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should bump this to F26; F27 should be released Nov 14 and that will EOL F25
- role: atomic_run | ||
ar_image: "{{ cockpit_cname }}" | ||
|
||
- role: atomic_images_list_verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to keep checking that the cockpit
image is still there after each operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can drop this this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks like there a bunch of extra image checks in the test. Could you audit the entire test and see if we really need each instance of atomic_images_list_verify
?
tests/atomic/main.yml
Outdated
- vars.yml | ||
|
||
pre_tasks: | ||
- name: Set cockpit container name for RHELAH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move these types of distro specific facts into vars files and use with_first_found
to load them in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using vars_files with the ansible_distribution name since there was no difference between the different versions of a distribution (ie fedora 26, 27, etc). The only thing I had to account for the ansible_distribution for cahc which is centosdev. If needed I could use include_vars with with_first_found. I didn't feel that was needed for this simple case.
tests/atomic/main.yml
Outdated
image_name: "{{ cockpit_short_name }}" | ||
check_mode: false | ||
|
||
- role: atomic_stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to drop a comment here to explain the json queries and what you are looking for.
tests/atomic/main.yml
Outdated
apl_image: "{{ fq_name }}" | ||
apl_options: "--storage=ostree" | ||
|
||
# The TYPE field doesn't show up in the json output so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug in atomic
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to file an upstream issue for that. I'll add a comment in the code with the issue: projectatomic/atomic#1129
Excellent work overall! I like that you prefixed variable names in the roles to make them more unique per role (like we are supposed to do!) I have a couple of minor comments, but I'm betting this can get merged very soon. Would like to kick it around myself, though |
This commit adds tests for the the atomic command. The tests revolve mostly around pulling images and installing/running containers with variations of the options in the atomic subcommand. These tests include: - Pull by fully qualified image name - Pull by short image name - Pull by fully qualified image name with --name option - Pull with tags - Pull by digest - Pull to ostree/docker storage - Images update command Most of the tests use the cockpit container. This container was chosen because it has most of the labels that the atomic command utilizes. For simple tests, the busybox container was chosen because it is small.
94760e7
to
7e0055a
Compare
The build of |
tests/atomic/main.yml
Outdated
- pull_tags | ||
|
||
pre_tasks: | ||
- name: Set cockpit container name for RHELAH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment correct, i.e. only for RHELAH?
Could we move the vars files under |
Should be possible. |
bot, retest this please |
|
||
- name: Save JSON to variable | ||
set_fact: | ||
acl_json: "{{ acl.stdout | to_json | from_json }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use both filters? Seems like you should just be able to use from_json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't need both. I'm not quite sure why I did that.
|
||
- name: Save JSON to variable | ||
set_fact: | ||
ail_json: "{{ ail.stdout | to_json | from_json }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question about both filters here
roles/docker_rmi/tasks/main.yml
Outdated
msg: "drmi_image is not defined" | ||
when: drmi_image is undefined | ||
|
||
- name: Set optioins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/optioins/options/
roles/docker_tag/tasks/main.yml
Outdated
- debug: | ||
msg: "dt_img: {{ dt_image }}" | ||
|
||
- debug: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to leave these debug:
statements here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, removed!
New fixup with the comments addressed. I also snuck in a fix to handle the new TOML /etc/containers/registries.conf |
replace: "[registries.insecure]\nregistries = ['{{ ansible_docker0.ipv4.address }}:5000']" | ||
dest: /etc/containers/registries.conf | ||
when: reg.stat.exists and toml.rc == 0 | ||
|
||
- name: add registeries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/registeries/registries/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
register: toml | ||
when: reg.stat.exists | ||
ignore_errors: true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally forgot to ignore errors on the grep so it failed when it wasn't a TOML file in the case of fedora/26/atomic. Fixed it here.
The CentOS failures are due to projectatomic/docker#285. CentOS won't use the fixed version of docker until projectatomic/docker#286 is fixed. The current version of docker on CentOS is using a version of docker that doesn't have a /etc/containers/registries.conf which causes the test to fail because the test uses an insecure registry. Once the docker fix is in CentOS the tests should pass. |
This commit adds tests for the the atomic command. The tests revolve
mostly around pulling images and installing/running containers with
variations of the options in the atomic subcommand. These tests include:
Most of the tests use the cockpit container. This container was chosen
because it has most of the labels that the atomic command utilizes. For
simple tests, the busybox container was chosen because it is small.