From 15b4979453ac9e85dc8e03d30d7ca440179dfc73 Mon Sep 17 00:00:00 2001 From: "Schmalzried, Terry (ts862m)" Date: Fri, 21 Aug 2020 15:59:22 -0400 Subject: Set Cloudify password Cloudify pod updates for sourcing password from CMPASS environment variable. Issue-ID: DCAEGEN2-1975 Change-Id: I5f297af9ad92389d0901eee463ea175751853838 Signed-off-by: Schmalzried, Terry (ts862m) --- cm-container/scripts/dcae-cleanup.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cm-container/scripts/dcae-cleanup.sh') diff --git a/cm-container/scripts/dcae-cleanup.sh b/cm-container/scripts/dcae-cleanup.sh index ce5c56b..b95b639 100755 --- a/cm-container/scripts/dcae-cleanup.sh +++ b/cm-container/scripts/dcae-cleanup.sh @@ -1,6 +1,6 @@ #!/bin/bash # ================================================================================ -# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -43,10 +43,12 @@ set -x set +e -# Get the CM admin password from the config file -# Brittle, but the container is built with an unchanging version of CM, -# so no real risk of a breaking change -CMPASS=$(grep 'admin_password:' /etc/cloudify/config.yaml | cut -d ':' -f2 | tr -d ' ') +# Expect Cloudify password to be in file mounted from Kubernetes secret, +# but allow overriding by CMPASS environment variable, +# and if not provided, use the default +CMPASS=${CMPASS:-$(cat /opt/onap/cm-secrets/password 2>/dev/null)} +CMPASS=${CMPASS:-admin} + TYPENAMES=[\\\"dcae.nodes.ContainerizedServiceComponent\\\",\\\"dcae.nodes.ContainerizedServiceComponentUsingDmaap\\\",\\\"dcae.nodes.ContainerizedPlatformComponent\\\",\\\"dcae.nodes.ContainerizedApplication\\\"] # Uninstall components managed by Cloudify -- cgit 1.2.3-korg