-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to use local scripts and configuration files in lieu of generated when using openshift ocp.sh script. #8156
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
…ted. Signed-off-by: James Drummond <james@devcomb.com>
bfa09e4
to
28f0f48
Compare
if [ $IMAGE_PULL_POLICY == "Always" ]; then | ||
docker pull "$IMAGE_INIT" | ||
fi | ||
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" eclipse/che-cli:${CHE_IMAGE_TAG} destroy --quiet --skip:pull --skip:nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is copy paste based on older version of script, please update it accordingly to the current state.
And personally, I don't like the idea of allowing to use local scripts which is error prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the idea for people not developing che using but for me it is much easier to use local scripts versus generated.
Will make the change of the copy paste issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a reason why we generate this, we can merge this but there should be some comments that this is errorprone and may not work as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added warning comments.
Signed-off-by: James Drummond <james@devcomb.com>
Signed-off-by: James Drummond <james@devcomb.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before merge please, test carefully single / multi user mode and deploying from scratch
Can one of the admins verify this patch? |
@benoitf I need another approval before I can merge. Let me know if 2 approvals are still needed for each PR per eclipse policy. |
@JamesDrummond well the PR has conflicting files |
@benoitf Reply beat my fix :) |
@benoitf @sleshchenko Can one of you review/approve? |
I tried to use your changes from your branch, so I execute
And I got the following output. As you can see OCP output[serg@sleschenko scripts]$ ./ocp.sh --deploy-che OCP using existing scripts in current folder. P.S. The same with |
Signed-off-by: James Drummond <james@devcomb.com>
94f0c52
to
405f09a
Compare
@sleshchenko Sorry it's my fault after I merged master changes from master didn't catch I had deploy part in there twice and out of generate script if statement. Fixed now. |
#wipeout config folder | ||
docker run -v "${CONFIG_DIR}":/to_remove alpine sh -c "rm -rf /to_remove/" || true | ||
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" eclipse/che-cli:${CHE_IMAGE_TAG} config --skip:pull --skip:nightly | ||
cd "${CONFIG_DIR}/instance/config/openshift/scripts/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${CONFIG_DIR}/instance/config/openshift/scripts/
is used twice. Please consider moving it into a separated variable like OPENSHIFT_SCRIPTS_FOLDER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added variable OPENSHIFT_SCRIPTS_FOLDER.
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" eclipse/che-cli:${CHE_IMAGE_TAG} config --skip:pull --skip:nightly | ||
cd "${CONFIG_DIR}/instance/config/openshift/scripts/" | ||
else | ||
echo "OCP using existing scripts in current folder." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous message contains information about configuration files
but this one doesn't. Should we add it here too?
To be sure that I understand configuration files
correctly: is it about yaml files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is shell scripts and yaml files needed to deploy che multi user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added configuration files
to second mesage.
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" eclipse/che-cli:${CHE_IMAGE_TAG} config --skip:pull --skip:nightly | ||
cd "${CONFIG_DIR}/instance/config/openshift/scripts/" | ||
else | ||
echo "OCP using existing scripts in current folder." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is shell scripts and yaml files needed to deploy che multi user
#Repull init image only if IMAGE_PULL_POLICY is set to Always | ||
if [ $IMAGE_PULL_POLICY == "Always" ]; then | ||
docker pull "$IMAGE_INIT" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ if [ $IMAGE_PULL_POLICY == "Always" ]; then
+ docker pull "$IMAGE_INIT"
+ fi
this must be moved out from if
statement because it should be considered in both cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.
@riuvshin @sleshchenko Updates complete. Please review. |
…SCRIPTS Signed-off-by: James Drummond <james@devcomb.com>
What does this PR do?
Allow user to local scripts and configuration files in lieu of generated by setting CHE_OPENSHIFT_GENERATE_SCRIPTS =false. Default will remain to generate scripts DEFAULT_CHE_OPENSHIFT_GENERATE_SCRIPTS =true.
What issues does this PR fix or reference?
NA
Release Notes
Allow user to use local scripts and configuration files in lieu of generated when using openshift ocp.sh script.
Signed-off-by: James Drummond james@devcomb.com