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 May 23, 2024
1 parent ae20351 commit e77a375
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
17 changes: 11 additions & 6 deletions charts/substra-backend/templates/job-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,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 line; do
# Extract the password as the last word
password=$(echo "$line" | awk '{print $NF}')
# Extract the username by removing the last word
user=$(echo "$line" | sed 's/ [^ ]*$//')
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 line; do
# Extract the password as the last word
password=$(echo "$line" | awk '{print $NF}')
# Extract the username by removing the last word
user=$(echo "$line" | sed 's/ [^ ]*$//')
done < /accounts/outgoing_organizations
envFrom:
- configMapRef:
name: {{ include "substra.fullname" . }}-orchestrator
Expand Down
8 changes: 4 additions & 4 deletions examples/values/backend-org-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config:
DEFAULT_THROTTLE_RATES: "120"
TASK_CACHE_DOCKER_IMAGES: "False"
LOG_LEVEL: DEBUG
organizationName: MyOrg1
organizationName: FirstOrg

# set the same creds as in localdev so they're the same everywhere in dev
database:
Expand Down Expand Up @@ -72,11 +72,11 @@ kaniko:

addAccountOperator:
incomingOrganizations:
- { name: MyOrg1MSP, secret: selfSecret1 }
- { name: First Organization, secret: selfSecret1 }
- { name: MyOrg2MSP, secret: organizationSecret1w2 }
- { name: MyOrg3MSP, secret: organizationSecret1w3 }
outgoingOrganizations:
- { name: MyOrg1MSP, secret: selfSecret1 }
- { name: First Organization, secret: selfSecret1 }
- { name: MyOrg2MSP, secret: organizationSecret2w1 }
- { name: MyOrg3MSP, secret: organizationSecret3w1 }

Expand Down Expand Up @@ -121,7 +121,7 @@ orchestrator:
mtls:
enabled: true
clientCertificate: orchestrator-tls-client-pair
mspID: MyOrg1MSP
mspID: First Organization
channels:
- mychannel:
restricted: false
Expand Down
4 changes: 2 additions & 2 deletions examples/values/backend-org-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ kaniko:

addAccountOperator:
incomingOrganizations:
- { name: MyOrg1MSP, secret: organizationSecret2w1 }
- { name: First Organization, secret: organizationSecret2w1 }
- { name: MyOrg2MSP, secret: selfSecret2 }
- { name: MyOrg3MSP, secret: organizationSecret2w3 }
outgoingOrganizations:
- { name: MyOrg1MSP, secret: organizationSecret1w2 }
- { name: First Organization, secret: organizationSecret1w2 }
- { name: MyOrg2MSP, secret: selfSecret2 }
- { name: MyOrg3MSP, secret: organizationSecret3w2 }

Expand Down

0 comments on commit e77a375

Please sign in to comment.