Unable to add a subcloud with mixed docker_registries configuration

Bug #1960063 reported by Tee Ngo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Tee Ngo

Bug Description

Brief Description
-----------------
Unable to add a subcloud with mixed docker_registries configuration such as:

docker_registries:
  k8s.gcr.io:
    url: myaws.private.com/k8s.gcr.io
    type: aws-ecr
    username: test_registry_user
    password: St8rlingX*
  gcr.io:
    url: myaws.private.registry.com/gcr.io
    type: aws-ecr
    username: test_registry_user
    password: St8rlingX*
  quay.io:
    url: quay.io
  docker.io:
    url: docker.io
  docker.elastic.co:
    url: myaws.private.registry.com/docker.elastic.co
    type: aws-ecr
    username: test_registry_user
    password: St8rlingX*
  ghcr.io:
    url: myaws.private.registry.com/ghcr.io
    type: aws-ecr
    username: test_registry_user
    password: St8rlingX*
  defaults:
    type: docker

Severity
--------
Critical

Steps to Reproduce
------------------
Add a subcloud with mixed docker_registries configuration (authenticated and unauthenticated registry sources)

Expected Behavior
------------------

Actual Behavior
----------------
Subcloud bootstrap fails with the following ansible error

TASK [bootstrap/persist-config : Create Barbican secret for elastic registry if credentials exist] ***
Thursday 03 February 2022 20:23:10 +0000 (0:00:00.015) 0:01:27.138 *****
fatal: [subcloud1]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'username'

    The error appears to have been in '/usr/share/ansible/stx-ansible/playbooks/roles/bootstrap/persist-config/tasks/main.yml': line 184, column 5, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - block:
      - name: Create Barbican secret for elastic registry if credentials exist
        ^ here

PLAY RECAP *********************************************************************
subcloud1 : ok=177 changed=45 unreachable=0 failed=1

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
Distributed Cloud

Branch/Pull Time/Commit
-----------------------
Feb. 02, 2022 master build

Last Pass
---------
This configuration has never been verified before

Timestamp/Logs
--------------
See error log above

Test Activity
-------------
Feature Testing

Workaround
----------
None

Tee Ngo (teewrs)
Changed in starlingx:
assignee: nobody → Tee Ngo (teewrs)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)
Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
description: updated
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.con
tags: added: stx.7.0 stx.config
removed: stx.con
tags: added: stx.distcloud
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/827888
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/6ee214d92751811657521a45655fefd5825bcf45
Submitter: "Zuul (22348)"
Branch: master

commit 6ee214d92751811657521a45655fefd5825bcf45
Author: Tee Ngo <email address hidden>
Date: Fri Feb 4 12:04:21 2022 -0500

    Fix bootstrap issue related to mixed registry config

    This commit fixes the mishandling of docker_registries config
    where elastic and ghcr registries are authenticated and docker
    registry is unauthenticated.

    Test plan:
      - Deploy a subcloud with mixed docker_registries config
        as described in LP1960063.
      - Deploy a subcloud with central registry as docker
        registries source.

    Closes-Bug: 1960063
    Change-Id: I0811c45a028aba51e7da4fbf5c9e91a1b5496f5f
    Signed-off by: Tee Ngo <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.