Skip to content

Propagate workspace .spec.started to DevWorkspaceRouting #604

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

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

amisevsk
Copy link
Collaborator

What does this PR do?

Add field .spec.started to DevWorkspaceRouting and propagate the owning workspace's .spec.started there. When a workspace is stopped, currently we simply end the routing reconcile early, but in the future this could be used to perform cleanup (e.g. remove services/routes for stopped workspaces).

This change has the effect of always triggering at least one reconcile in the routing controller when a workspace is started.

What issues does this PR fix or reference?

Closes #602

Is it tested? How?

Start a workspace, stop a workspace.

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Add .spec.started field to DevWorkspaceRouting and propagate the value
from DevWorkspace.spec.started to it. This ensures that a workspace's
routing object will always queue at least one reconcile when it is
started, and opens the option to clean up networking objects when a
workspace is stopped in the future.

Signed-off-by: Angel Misevski <[email protected]>
@amisevsk
Copy link
Collaborator Author

/test v8-devworkspace-operator-e2e, v8-che-happy-path

@openshift-ci
Copy link

openshift-ci bot commented Sep 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, JPinkney, sleshchenko

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JPinkney,amisevsk,sleshchenko]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@amisevsk amisevsk merged commit 527ad32 into devfile:main Sep 22, 2021
@amisevsk amisevsk deleted the propagate-routing-started branch September 22, 2021 15:40
@sleshchenko
Copy link
Member

sleshchenko commented Sep 23, 2021

Seems it's a breaking chang and DWCO fails to route routing https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/devfile_devworkspace-operator/604/pull-ci-devfile-devworkspace-operator-main-v8-che-happy-path/1440398068900958208/artifacts/che-happy-path/che-happy-path/artifacts/eclipse-che-info/che-operator-65c7f8454d-tw5fp-che-operator.log

and screencast proves it, but happy test is too positive and happy with that ) Or it's just PR check. Will ask @musienko-maxim to discover the reason.

Screenshot_20210923_131019

And we probably should revert it and the only safest solution I see - use annotation instead.

https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/devfile_devworkspace-operator/604/pull-ci-devfile-devworkspace-operator-main-v8-che-happy-path/1440398068900958208/artifacts/che-happy-path/che-happy-path/build-log.txt suggests it should fail

            ‣ DriverHelper.waitAndClick - Polling timed out attempt #5, retrying with 1000ms timeout
(node:247) UnhandledPromiseRejectionWarning: TimeoutError: Exceeded maximum clicking attempts, the 'By(css selector, li[title='run'] div.theia-tab-icon-label)' element is not clickable
    at DriverHelper.waitAndClick (/tmp/e2e/utils/DriverHelper.ts:301:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:247) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 21)
            ‣ DriverHelper.getDriver
  [WARN] Property DELETE_WORKSPACE_ON_FAILED_TEST se to true - trying to stop and delete running workspace.
          ▼ TestWorkspaceUtil.cleanUpRunningWorkspace java-spring-petclinic
          ▼ TestWorkspaceUtil.getIdOfRunningWorkspace
Can not get bearer token. URL used: http://keycloak-eclipse-che.apps.ci-op-4inimmh1-bf4f0.origin-ci-int-gce.dev.rhcloud.com/auth/realms/che/protocol/openid-connect/token
(node:247) UnhandledPromiseRejectionWarning: Error: Request failed with status code 503
    at createError (/tmp/e2e/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/tmp/e2e/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/tmp/e2e/node_modules/axios/lib/adapters/http.js:260:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:247) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 23)
npm ERR! code ELIFECYCLE
npm ERR! errno 10
npm ERR! [email protected] test-devworkspace-happy-path: `./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-devworkspace-happy-path.opts`
npm ERR! Exit status 10
npm ERR! 
npm ERR! Failed at the [email protected] test-devworkspace-happy-path script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/seluser/.npm/_logs/2021-09-21T20_26_17_111Z-debug.log
+ EXIT_CODE=10

@sleshchenko
Copy link
Member

Should fix the problem with always happy happy path test #609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propagate workspace started state to DevWorkspaceRouting
3 participants