Add support for the github docker image registry

This commit adds the ghcr registry to the list of supported
docker registries as preparation for the ongoing support in
StarlingX for the multus, sriov-cni and sriov device plugin
images.

These projects have moved to the github registry.

Depends-On: https://review.opendev.org/c/starlingx/config/+/803364
Story: 2008972
Task: 42869

Signed-off-by: Steven Webster <steven.webster@windriver.com>
Change-Id: Ib6cc434f54600f6cc8e569b8851def7cf5151514
This commit is contained in:
Steven Webster
2021-07-28 15:40:19 -04:00
parent 9c319adb65
commit d34210522c
10 changed files with 69 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
---
#
# Copyright (c) 2019 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -17,6 +17,7 @@
- { name: 'quay_registry', value: { } }
- { name: 'docker_registry', value: { } }
- { name: 'elastic_registry', value: { } }
- { name: 'ghcr_registry', value: { } }
- name: Put docker registries into a single variable
set_fact:
@@ -27,3 +28,4 @@
- { name: 'quay.io', value: "{{ quay_registry }}" }
- { name: 'docker.io', value: "{{ docker_registry }}" }
- { name: 'docker.elastic.co', value: "{{ elastic_registry }}" }
- { name: 'ghcr.io', value: "{{ ghcr_registry }}" }

View File

@@ -1,6 +1,6 @@
---
#
# Copyright (c) 2019-2020 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -22,6 +22,7 @@
- { name: 'quay_registry', value: { url: 'quay.io' } }
- { name: 'docker_registry', value: { url: 'docker.io' } }
- { name: 'elastic_registry', value: { url: 'docker.elastic.co' } }
- { name: 'ghcr_registry', value: { url: 'ghcr.io' } }
when: mode is regex("^upgrade_") or
mode == 'trident_install'
@@ -35,6 +36,7 @@
- { name: "quay_registry", value: "{{ quay_registry }}" }
- { name: "docker_registry", value: "{{ docker_registry }}" }
- { name: "elastic_registry", value: "{{ elastic_registry }}" }
- { name: "ghcr_registry", value: "{{ ghcr_registry }}" }
when: registry.value.type is defined and
registry.value.type == 'aws-ecr'
no_log: true
@@ -91,9 +93,10 @@
- { default_url: 'quay.io', replaced_url: "{{ quay_registry.url }}" }
- { default_url: 'docker.io', replaced_url: "{{ docker_registry.url }}" }
- { default_url: 'docker.elastic.co', replaced_url: "{{ elastic_registry.url }}" }
- { default_url: 'ghcr.io', replaced_url: "{{ ghcr_registry.url }}" }
# Disable the log to not expose registry password
- name: Log in k8s, gcr, quay, docker registries if credentials exist
- name: Log in k8s, gcr, quay, ghcr, docker registries if credentials exist
docker_login:
registry: "{{ item['url'] }}"
username: "{{ item['username'] }}"
@@ -107,6 +110,7 @@
- "{{ gcr_registry }}"
- "{{ quay_registry }}"
- "{{ docker_registry }}"
- "{{ ghcr_registry }}"
when: item.username is defined
no_log: true
@@ -142,7 +146,7 @@
msg: "{{ download_images_output.stdout_lines }}"
# Disable the log to not expose registry password
- name: Log out of k8s, gcr, quay, docker registries if credentials exist
- name: Log out of k8s, gcr, quay, ghcr docker registries if credentials exist
docker_login:
registry: "{{ item['url'] }}"
state: absent
@@ -151,5 +155,6 @@
- "{{ gcr_registry }}"
- "{{ quay_registry }}"
- "{{ docker_registry }}"
- "{{ ghcr_registry }}"
when: item.username is defined
no_log: true