Skip to content

Commit

Permalink
chore(charts/substra-backend): handle whitespaced orgnames
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Camalon <[email protected]>
  • Loading branch information
thbcmlowk committed Jun 3, 2024
1 parent ba79d62 commit 973e428
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions charts/substra-backend/templates/job-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ spec:
done < /accounts/users
## IncomingOrganization
while read -r user_password; do
read user password <<< "$user_password"
./manage.py create_incoming_organization "$user" "$password"
while IFS= read -r org_password; do
# Extract the password as the last word
password=$(echo "$user_password" | awk '{print $NF}')
# Extract the username by removing the last word
orgname=$(echo "$user_password" | sed 's/ [^ ]*$//')
./manage.py create_incoming_organization "$orgname" "$password"
done < /accounts/incoming_organizations
## OutgoingOrganization
while read -r user_password; do
read user password <<< "$user_password"
./manage.py create_outgoing_organization "$user" "$password"
while IFS= read -r org_password; do
# Extract the password as the last word
password=$(echo "$org_password" | awk '{print $NF}')
# Extract the username by removing the last word
orgname=$(echo "$org_password" | sed 's/ [^ ]*$//')
./manage.py create_outgoing_organization "$orgname" "$password"
done < /accounts/outgoing_organizations
envFrom:
- configMapRef:
Expand Down

0 comments on commit 973e428

Please sign in to comment.