Skip to content

Commit 972b8df

Browse files
akarivOriHoch
authored andcommitted
Support setting custom admin email on creation (#13)
* Set proper permissions to directories holding authorized_keys * More permission fixes and install sftp server * Support setting custom admin email on creation
1 parent 7fdef76 commit 972b8df

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cca-operator/update-instance.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ import yaml;
1414
print(yaml.load(open("'${CKAN_VALUES_FILE}'")).get("domain", ""))
1515
' 2>/dev/null`
1616

17+
CKAN_ADMIN_EMAIL=`python3 -c '
18+
import yaml;
19+
print(yaml.load(open("'${CKAN_VALUES_FILE}'")).get("ckanAdminEmail", "admin@${INSTANCE_ID}"))
20+
'`
21+
1722
WITH_SANS_SSL=`python3 -c '
1823
import yaml;
1924
print("1" if yaml.load(open("'${CKAN_VALUES_FILE}'")).get("withSansSSL", False) else "0")
@@ -145,7 +150,7 @@ else
145150
! kubectl $KUBECTL_GLOBAL_ARGS -n "${INSTANCE_NAMESPACE}" create secret generic ckan-admin-password "--from-literal=CKAN_ADMIN_PASSWORD=${CKAN_ADMIN_PASSWORD}" && exit 1
146151
echo y \
147152
| kubectl $KUBECTL_GLOBAL_ARGS -n ${INSTANCE_NAMESPACE} exec -it ${CKAN_POD_NAME} -- bash -c \
148-
"ckan-paster --plugin=ckan sysadmin -c /etc/ckan/production.ini add admin password=${CKAN_ADMIN_PASSWORD} email=admin@${INSTANCE_ID}" \
153+
"ckan-paster --plugin=ckan sysadmin -c /etc/ckan/production.ini add admin password=${CKAN_ADMIN_PASSWORD} email=${CKAN_ADMIN_EMAIL}" \
149154
> /dev/stderr
150155
[ "$?" != "0" ] && exit 1
151156
fi

0 commit comments

Comments
 (0)