Skip to content

Commit 453ff67

Browse files
committed
fix: use correct mongo user password to instance config
SE-6524
1 parent 14ba7f7 commit 453ff67

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

manifests/phd-mongodb-provision-template.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ spec:
144144
MONGODB_CLUSTER_ID="{{workflow.parameters.mongodb-cluster-id}}"
145145
K8s_API_BEARER_TOKEN="{{workflow.parameters.k8s-api-bearer-token}}"
146146
147-
echo "Creating user via DigitalOcean API: $USERNAME for database $DATABASE_NAME"
148-
echo "The current password is $PASSWORD"
147+
echo "Creating user via DigitalOcean API: $USERNAME"
149148
150149
RESPONSE=$(curl -s -X POST \
151150
-H "Content-Type: application/json" \
@@ -156,7 +155,6 @@ spec:
156155
if echo "$RESPONSE" | grep -q "\"name\":\"$USERNAME\""; then
157156
echo "User $USERNAME created successfully"
158157
PASSWORD=$(echo "$RESPONSE" | grep -o '"password":"[^"]*"' | cut -d'"' -f4)
159-
echo "Generated password: $PASSWORD"
160158
elif echo "$RESPONSE" | grep -q "already exists"; then
161159
echo "User $USERNAME already exists"
162160
else

tooling/phd/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def detect_local_template( # pylint: disable=too-many-locals,too-many-nested-bl
236236
def build_instance_config( # pylint: disable=too-many-locals,too-many-positional-arguments
237237
instance_name: str,
238238
config_data: dict,
239-
k8s_api_bearer_token: str,
239+
k8s_api_bearer_token: str | None = None,
240240
platform_name: str | None = None,
241241
edx_platform_repository: str | None = None,
242242
edx_platform_version: str | None = None,
@@ -261,7 +261,8 @@ def build_instance_config( # pylint: disable=too-many-locals,too-many-positiona
261261
"PHD_INSTANCE_NAME": instance_name,
262262
}
263263

264-
instance_config["PHD_KUBERNETES_API_BEARER_TOKEN"] = k8s_api_bearer_token
264+
if k8s_api_bearer_token is not None:
265+
instance_config["PHD_KUBERNETES_API_BEARER_TOKEN"] = k8s_api_bearer_token
265266

266267
if platform_name is not None:
267268
instance_config["PHD_PLATFORM_NAME"] = platform_name

0 commit comments

Comments
 (0)