Skip to content

Commit 086dd58

Browse files
authored
Merge pull request #597 from oracle/develop-OWLS-70526
Develop owls 70526
2 parents 5c43524 + 0f2a455 commit 086dd58

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/scripts/initialize-internal-operator-identity.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

5-
set -x
5+
# do not turn on 'set -x' since it can print sensitive info, like secrets and private keys, to the oeprator log
6+
#set -x
67

78
if [ "$#" != 0 ] ; then
89
1>&2 echo "Syntax: ${BASH_SOURCE[0]}"
@@ -95,31 +96,37 @@ function recordInternalIdentity {
9596
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`
9697
KUBERNETES_MASTER="https://kubernetes.default.svc"
9798

99+
# the request body prints out the atz token
100+
# don't specify -v so that the token is not printed to the operator log
101+
102+
# the response body from PATCH prints out the config map / secret
103+
# send stdout to /dev/null to supress this so that we don't print the cert or private key to the operator log
104+
98105
# put the new certificate in the operator's config map so that it will be available
99106
# the next time the operator is started
100107
NEW_CERT=`cat ${INTERNAL_CERT_BASE64_PEM}`
101108
PATCH_DOCUMENT="{ \"data\": { \"${CERT_PROPERTY}\" : \"${NEW_CERT}\" } }"
102109
curl \
103-
-v \
104110
--cacert $CACERT \
105111
-H "Authorization: Bearer $TOKEN" \
106112
-H "Content-Type: application/merge-patch+json" \
107113
-d "${PATCH_DOCUMENT}" \
108114
-X PATCH \
109-
$KUBERNETES_MASTER/api/v1/namespaces/$NAMESPACE/configmaps/weblogic-operator-cm
115+
$KUBERNETES_MASTER/api/v1/namespaces/$NAMESPACE/configmaps/weblogic-operator-cm \
116+
> /dev/null
110117

111118
# put the new private key in the operator's secret so that it will be available
112119
# the next time the operator is started
113120
NEW_KEY=`base64 -i ${INTERNAL_KEY_PEM} | tr -d '\n'`
114121
PATCH_DOCUMENT="{ \"data\": { \"${KEY_PROPERTY}\" : \"${NEW_KEY}\" } }"
115122
curl \
116-
-v \
117123
--cacert $CACERT \
118124
-H "Authorization: Bearer $TOKEN" \
119125
-H "Content-Type: application/merge-patch+json" \
120126
-d "${PATCH_DOCUMENT}" \
121127
-X PATCH \
122-
$KUBERNETES_MASTER/api/v1/namespaces/$NAMESPACE/secrets/weblogic-operator-secrets
128+
$KUBERNETES_MASTER/api/v1/namespaces/$NAMESPACE/secrets/weblogic-operator-secrets \
129+
> /dev/null
123130
}
124131

125132
function createInternalIdentity {

0 commit comments

Comments
 (0)