Set container namespace to local registry in consumer job

Current in container-prep-parameters file, namespace is pointing
to docker.io in consumer job but it needs to be pointing
to local registry to pull containers from provider job when
consumer_job is set to true.

Added local_registry_ip_address and port to the default vars to
avoid vars not defined issue.

It fixes the same.

Change-Id: Iaa2b3b0074732287b618fe268a7e8876f14c6348
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
This commit is contained in:
Chandan Kumar (raukadah) 2020-09-22 22:05:57 +05:30
parent 2f335749c9
commit a564a865a2
4 changed files with 15 additions and 1 deletions

View File

@ -14,3 +14,5 @@ container_prep_additional_repos: ""
update_containers_repo: >-
{% if compressed_gating_repo is defined %}{{ gating_repo_name }},{% endif %}delorean-current
{%- if container_prep_additional_repos -%},{{ container_prep_additional_repos }}{%- endif -%}
local_registry_ip: 127.0.0.1
local_registry_port: 5001

View File

@ -42,7 +42,12 @@ openstack overcloud container image prepare \
--output-images-file {{ working_dir }}/overcloud_containers.yaml \
--output-env-file {{ working_dir }}/containers-default-parameters.yaml \
${PREPARE_ARGS} \
--namespace {{ docker_registry_host }}/{{ docker_registry_namespace_used }} \
{% if job.consumer_job | default(false) | bool and job.registry_ip_address is defined %}
--namespace "{{ job.registry_ip_address }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" \
{% else %}
--namespace "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}" \
{% endif %}
--tag {{ container_build_id }} \
{% if docker_prep_prefix is defined %}
--prefix "{{ docker_prep_prefix }}" \

View File

@ -113,3 +113,6 @@ undercloud_upgrade_composable_scenario: ""
undercloud_prep_post_hook_script: ""
undercloud_tht_rpm_url: ""
download_undercloud_templates_rpm: false
local_registry_ip: 127.0.0.1
local_registry_port: 5001

View File

@ -35,7 +35,11 @@ parameter_defaults:
{% endif %}
set:
tag: "{{ container_build_id }}"
{% if job.consumer_job | default(false) | bool and job.registry_ip_address is defined %}
namespace: "{{ job.registry_ip_address }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}"
{% else %}
namespace: "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}"
{% endif %}
name_prefix: "{{ docker_prep_prefix }}"
name_suffix: "{{ docker_prep_suffix }}"
rhel_containers: "{{ rhel_containers }}"