You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add flag to control execution of secret generation job and allo… (#56)
* feat: add flag to control execution of secret generation job and allow for manual creation
* run pre-commit
---------
Co-authored-by: Ore Olarewaju <ore.olarewaju@aleph-alpha.com>
Copy file name to clipboardExpand all lines: helm/qs-minio/templates/configmap-secret-creation-script.yaml
+33-34Lines changed: 33 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ metadata:
13
13
data:
14
14
create-secrets.sh: |
15
15
#!/bin/bash
16
-
16
+
17
17
# Set error handling
18
18
[[ "${FAIL_ON_ERROR}" == "true" ]] && set -e
19
19
@@ -67,17 +67,17 @@ data:
67
67
local endpoint_url=$2
68
68
local username=$3
69
69
local user_key=$4
70
-
70
+
71
71
local existing_endpoint=$(kubectl get secret "$secret_name" -o jsonpath='{.data.endpointUrl}' 2>/dev/null | base64 -d)
72
72
local existing_username=$(kubectl get secret "$secret_name" -o jsonpath="{.data.$user_key}" 2>/dev/null | base64 -d)
73
73
local existing_minio_label=$(kubectl get secret "$secret_name" -o jsonpath='{.metadata.labels.qs-minio/instance}' 2>/dev/null)
74
-
74
+
75
75
local needs_update=false
76
-
76
+
77
77
if [[ "$existing_endpoint" != "$endpoint_url" ]]; then print_warning "Endpoint URL changed: '$existing_endpoint' -> '$endpoint_url'" >&2; needs_update=true; fi
78
78
if [[ "$existing_username" != "$username" ]]; then print_warning "Username changed or missing: '$existing_username' -> '$username'" >&2; needs_update=true; fi
79
79
if [[ "$existing_minio_label" != "${INSTANCE_NAME}" ]]; then print_warning "Instance label changed" >&2; needs_update=true; fi
80
-
80
+
81
81
echo "$needs_update"
82
82
}
83
83
@@ -91,14 +91,14 @@ data:
91
91
local password_key=$6
92
92
local action=$7
93
93
local bucket=$8 # Optional bucket parameter
94
-
94
+
95
95
local base_args="--from-literal=$user_key=$username --from-literal=$password_key=$password --from-literal=endpointUrl=$host"
0 commit comments