commit 112c4e236fa7653bc37f0dea976afb90695294c9 Author: Chandan Kumar (raukadah) Date: Wed Oct 7 12:17:23 2020 +0530 Added exclude list for victoria release If it is missing, then it will always give "AnsibleUndefinedVariable: 'dict object' has no attribute 'victoria'" while building containers in periodic job as ci_branch looks for that key which is missing, adding it fixes the issue. Change-Id: I1cabcff2e507e6455e09839291bf9c4a7e0fa750 Signed-off-by: Chandan Kumar (raukadah) diff --git a/roles/build-containers/templates/build.sh.j2 b/roles/build-containers/templates/build.sh.j2 index 1988b67..cc3ef51 100644 --- a/roles/build-containers/templates/build.sh.j2 +++ b/roles/build-containers/templates/build.sh.j2 @@ -10,7 +10,7 @@ TRIPLEO_CI_PATH="{{ ansible_user_dir }}/src/opendev.org/openstack/tripleo-ci" {% if use_kolla | default(true) %} openstack overcloud container image build {{ container_config }}\ --kolla-config-file {{ workspace }}/kolla-build.conf \ - {% if ci_branch != 'rocky' %} + {% if ci_branch != 'rocky' and ci_branch in exclude_containers %} {% for item in exclude_containers[ci_branch] %} --exclude {{ item }} \ {% endfor %} @@ -23,7 +23,7 @@ egrep "^- " containers-to-build-full.log | awk '{ print $2 }' > containers-expec ### build openstack overcloud container image build {{ container_config }}\ - {% if ci_branch != 'rocky' %} + {% if ci_branch != 'rocky' and ci_branch in exclude_containers %} {% for item in exclude_containers[ci_branch] %} --exclude {{ item }} \ {% endfor %} @@ -94,9 +94,12 @@ openstack tripleo container image build \ {% if rhel_modules is defined %} --rhel-modules {{ rhel_modules | join(",") }} \ {% endif %} -{% for item in exclude_containers[osp_branch|default(ci_branch)] %} +{% set branch = osp_branch|default(ci_branch) %} +{% if branch in exclude_containers %} +{% for item in exclude_containers[branch] %} --exclude {{ item }} \ {% endfor %} +{% endif %} --tag {{ version_hash }} \ --base {{ containers_base_image | default('ubi8') }} \ --prefix {{ container_name_prefix }} \ diff --git a/roles/build-containers/vars/main.yaml b/roles/build-containers/vars/main.yaml index b61ddc7..996c2e5 100644 --- a/roles/build-containers/vars/main.yaml +++ b/roles/build-containers/vars/main.yaml @@ -9,6 +9,8 @@ virtualenv_python: 7: python 8: python3 +# Current implementation assumes that any branch name not mentioned here +# would default to the excludes defined on master branch. exclude_containers: master: &exclude_containers - fluentd @@ -23,6 +25,7 @@ exclude_containers: - sensu-client - sensu-base - influxdb + victoria: *exclude_containers ussuri: *exclude_containers train: *exclude_containers stein: