ee_utilities
ee_utilities copied to clipboard
ee_base_image not consistently overwritten by images: base_image:
Summary
Documentation indicates that the
images:
base_image:
section of an execution environment definition will override ee_base_image
. This is true within execution_environment.yml.j2, but not within the task Pull builder images.
This results in a failure in the following circumstance:
- The
ee_base_image
var is not defined -
base_image
is not defined as a top-level key in the execution environment definition -
images: base_image:
is defined in the execution environment definition
In this situation, the Pull builder images
task pulls the image as defined in vars/main.yml
. However, since this doesn't match images: base_image:
, the Run the Ansible Builder Program task may fail if a login is required to pull the image.
Issue Type
- Bug Report
Desired Behavior
The base image should be pulled, respecting the ee_base_registry_username
and ee_base_registry_password
variables when needed.
Actual Behavior
"Error: creating build container: initializing source docker://registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest: unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication",
STEPS TO REPRODUCE
- Do not set
ee_base_image
- Use the following definition for an execution environment:
- name: ee_bug_report_image
tag: 2024-03-20
dependencies:
python:
- python-dateutil>=2.7.0
system:
- openldap-devel
images:
base_image:
name: registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
Suggested Resolution
Change the Pull builder images
task from
name: "{{ __execution_environment_definition.base_image | default(ee_base_image) }}"
to
name: "{{ __execution_environment_definition.images.base_image | default(__execution_environment_definition.base_image) | default(ee_base_image) }}"