Conversation
741f79f to
fd38459
Compare
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
fd38459 to
ce3463e
Compare
| @@ -0,0 +1,46 @@ | |||
| apiVersion: batch/v1beta1 | |||
There was a problem hiding this comment.
let's rename this file to cp-home-creator-job.yaml
| image: ${CP_DOCKER_DIST_SRV}lifescience/cloud-pipeline:home-dirs-$CP_VERSION | ||
| imagePullPolicy: IfNotPresent | ||
| securityContext: | ||
| privileged: true |
There was a problem hiding this comment.
I believe we don't really need this, right?
| echo "-> User $user_name verified: $user_id" | ||
|
|
||
| echo "-> Checking ssh key for user $user_name" | ||
| if ! ensure_user_ssh_keys "$user_id" "$user_name" "$user_name_full"; then |
There was a problem hiding this comment.
for this action I would also added additional parameter to be able to enable/disable it, the same as quotas
| ssh_pub=$(echo "$response" | jq -r '.payload[].data.ssh_pub.value // 0') | ||
|
|
||
| if [ -z "$ssh_priv" ] || [ "$ssh_priv" = "0" ]; then | ||
| echo "User $user_name does not have a private ssh key, generating" |
There was a problem hiding this comment.
probably additional message needed if user already has it
| return 1 | ||
| fi | ||
|
|
||
| if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]] && verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then |
There was a problem hiding this comment.
if we split these checks like:
if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]] ; then
if verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then
echo "<some error message>"
return 1
fi
.....
fi
it will be more readable
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
| fi | ||
|
|
||
| if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]]; then | ||
| if verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then |
There was a problem hiding this comment.
actually since we already perform pre-flight check in https://github.com/epam/cloud-pipeline/pull/4342/changes#diff-869eb826d01074ecddde60ab60b1ac6c2663c7e844435751d642ffad26fdc72aR419, I think we don't need it here
|
|
||
| if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]]; then | ||
| if ! verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" || ! verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then | ||
| echo "[ERROR] CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE is true but CP_HOME_DIRS_ID_FILE_SHARE and/or CP_HOME_DIRS_ADDR_FILE_SHARE are not set. FS home storage will be skipped. Exiting..." |
There was a problem hiding this comment.
error message a little bit strange, we are saying FS home storage will be skipped but then exit abnormally from the script
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
This PR related to #4292