Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-591

Crwctl server:stop requires a token, fails without it.

XMLWordPrintable

    • -
    • Workaround Exists
    • Hide

      To use server:stop first get the UAT:

      export codereadyNamespace=<removing-codeready-Namespace>
      
      export KEYCLOAK_URL=$(oc get route/keycloak -n ${codereadyNamespace} -o jsonpath='{.spec.host}')
      export KEYCLOAK_BASE_URL="http://${KEYCLOAK_URL}/auth"
      export USER_ACCESS_TOKEN=$(curl -X POST $KEYCLOAK_BASE_URL/realms/codeready/protocol/openid-connect/token \
                             -H "Content-Type: application/x-www-form-urlencoded" \
                             -d "username=admin" \
                             -d "password=admin" \
                             -d "grant_type=password" \
                             -d "client_id=codeready-public" | jq -r .access_token)
      
      crwctl/bin/crwctl server:stop -n ${codereadyNamespace} --access-token=$USER_ACCESS_TOKEN
      
      oc project ${codereadyNamespace}
      oc delete deployment codeready-operator
      oc delete checluster codeready-workspaces
      oc delete project ${codereadyNamespace}
      
      • after removal of CRW with OS OAuth support
      oc describe project ${codereadyNamespace}
      oc delete clusterrolebinding codeready-operator
      
      • how to delete terminating CRW project
      oc patch checluster codeready-workspaces -p '{ "metadata": { "finalizers": null }}' --type merge -n=${codereadyNamespace}
      
      • how to delete termination custom resource definition removal
      oc patch customresourcedefinition/checlusters.org.eclipse.che -p '{ "metadata": { "finalizers": null }}' --type merge
      
      Show
      To use server:stop first get the UAT: export codereadyNamespace=<removing-codeready-Namespace> export KEYCLOAK_URL=$(oc get route/keycloak -n ${codereadyNamespace} -o jsonpath= '{.spec.host}' ) export KEYCLOAK_BASE_URL= "http: //${KEYCLOAK_URL}/auth" export USER_ACCESS_TOKEN=$(curl -X POST $KEYCLOAK_BASE_URL/realms/codeready/protocol/openid-connect/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "username=admin" \ -d "password=admin" \ -d "grant_type=password" \ -d "client_id=codeready- public " | jq -r .access_token) crwctl/bin/crwctl server:stop -n ${codereadyNamespace} --access-token=$USER_ACCESS_TOKEN oc project ${codereadyNamespace} oc delete deployment codeready- operator oc delete checluster codeready-workspaces oc delete project ${codereadyNamespace} after removal of CRW with OS OAuth support oc describe project ${codereadyNamespace} oc delete clusterrolebinding codeready- operator how to delete terminating CRW project oc patch checluster codeready-workspaces -p '{ "metadata" : { "finalizers" : null }}' --type merge -n=${codereadyNamespace} how to delete termination custom resource definition removal oc patch customresourcedefinition/checlusters.org.eclipse.che -p '{ "metadata" : { "finalizers" : null }}' --type merge
    • Hide

      Install CRW 2.0.x via crwctl
      Attempt to remove it using the documented procedures

      Show
      Install CRW 2.0.x via crwctl Attempt to remove it using the documented procedures

      Users following the documentation [1] find that 'crwctl server:stop' gives an error message:

      .....
      Scale "plugin registry" deployment to zero
      Wait until Plugin registry pod is deleted
      › Error: E_AUTH_REQUIRED - CodeReady Workspaces authentication is enabled and an access token need to be provided (flag --access-token).
      › For instructions to retrieve a valid access token refer to https://www.eclipse.org/che/docs/che-6/authentication.html

      [1] https://access.redhat.com/documentation/en-us/red_hat_codeready_workspaces/2.0/html-single/installation_guide/index#uninstalling-codeready-workspaces-after-crwctl-installation_uninstalling-codeready-workspaces

              abazko Anatolii Bazko
              rhn-support-rick Rick Wagner
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: