Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
  • Loading branch information
flacatus committed Feb 12, 2021
1 parent ecf63a9 commit ae8639f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .ci/cico_updates_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ source "${OPERATOR_REPO}"/.github/bin/oauth-provision.sh
#Stop execution on any error
trap "catchFinish" EXIT SIGINT

overrideDefaults() {
export OAUTH="true"
}

runTests() {
"${OPERATOR_REPO}"/olm/testUpdate.sh "openshift" "stable" ${NAMESPACE}
waitEclipseCheDeployed ${LAST_PACKAGE_VERSION}
Expand All @@ -33,7 +29,6 @@ runTests() {
}

init
overrideDefaults
provisionOpenShiftOAuthUser
initStableTemplates "openshift" "stable"
runTests
8 changes: 4 additions & 4 deletions .github/bin/oauth-provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function provisionOAuth() {
# Obtain from Keycloak the token to make api request authentication
IDP_TOKEN=$(curl -k --location --request POST ''$IDP_HOST'/auth/realms/master/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=admin' \
--data-urlencode 'username='$IDP_USER'' \
--data-urlencode 'password='$IDP_PASSWORD'' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=admin-cli' | jq -r .access_token)
Expand All @@ -58,7 +58,7 @@ function provisionOAuth() {
--data '{
"identityProvider": "openshift-v4",
"userId": "'$OCP_USER_UID'",
"userName": "admin"
"userName": "'$IDP_USER'"
}'

# Create OAuthClientAuthorization object for Eclipse Che in Cluster.
Expand All @@ -83,8 +83,8 @@ UPDATE federated_identity SET token ='{"access_token":"INSERT_TOKEN_HERE","expir
WHERE federated_username = 'admin'
EOF

TOKEN=$(oc whoami -t)
sed -i "s|INSERT_TOKEN_HERE|$TOKEN|g" path.sql
OCP_TOKEN=$(oc whoami -t)
sed -i "s|INSERT_TOKEN_HERE|$OCP_TOKEN|g" path.sql

# Insert sql script inside of postgres and execute it.
POSTGRES_POD=$(oc get pods -o json -n eclipse-che | jq -r '.items[] | select(.metadata.name | test("postgres-")).metadata.name')
Expand Down

0 comments on commit ae8639f

Please sign in to comment.