Changed Trident secret and registry credentials

Changed Trident secret name from "trident-local-registry-secret" to
"default-registry-key" and got registry credentials from sysinv.

Closes-Bug: 1937301
Signed-off-by: Joao Victor Portal <Joao.VictorPortal@windriver.com>
Change-Id: I8bc236f267b878081de2a54b701a32d60175288f
This commit is contained in:
Joao Victor Portal
2021-08-23 17:30:59 -03:00
parent 6949e18927
commit b4ed5c5e42
3 changed files with 8 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ trident_metrics_port: 8001
trident_deploy_only_on_controllers: false
trident_force_reinstall: false
trident_secret_name: "trident-local-registry-secret"
trident_secret_name: "default-registry-key"
# Extra parameters to be given to the tridentctl install command
# If you want to configure Ipv6 add "--use-ipv6" to this list

View File

@@ -120,10 +120,10 @@
vars:
script_content: |
import keyring
password = keyring.get_password("CGCS", "admin")
password = keyring.get_password("sysinv", "services")
if not password:
raise Exception("Local registry password not found.")
print(dict(username='admin', password=str(password)))
print(dict(username='sysinv', password=str(password)))
shell: "{{ script_content }}"
args:
executable: /usr/bin/python

View File

@@ -56,6 +56,11 @@
when: create_ns_output.rc is defined and create_ns_output.rc !=0 and
create_ns_output.stderr is not search('AlreadyExists')
- name: Fail if the docker registry secret name to be used differs from default name
fail:
msg: "Trident secret name for docker registry credentials differs from default value 'default-registry-key'"
when: trident_secret_name != "default-registry-key"
- name: Check if secret exists
command: kubectl -n {{ trident_namespace }} get secret {{ trident_secret_name }}
environment: