Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ee_base_image not consistently overwritten by images: base_image: #147

Open
kpavon-silex opened this issue Mar 21, 2024 · 0 comments
Open
Labels
bug Something isn't working new

Comments

@kpavon-silex
Copy link

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) }}"

@kpavon-silex kpavon-silex added bug Something isn't working new labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new
Projects
None yet
Development

No branches or pull requests

1 participant