-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: add WorkspaceStopped method to RoutingSolver #839
Conversation
For more context, the approach for eclipse-che/che-operator#1386 is that the traefik config is updated when the devworkspace stops. The traefik config is updated so that the mainurl for the workspace is routed to the dashboard. I use the |
Signed-off-by: David Kwon <[email protected]>
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.
This is a nice improvement 👍
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dkwon17, ibuziuk The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Generally looks good, great addition!
func (d *DevWorkspaceRouting) IsWorkspaceStopped() bool { | ||
return d.Annotations != nil && d.Annotations[constants.DevWorkspaceStartedStatusAnnotation] == "false" | ||
} |
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'm not 100% on whether or not the type definition files should include struct methods like this, but this one is probably fine.
} | ||
|
||
if instance.IsWorkspaceStopped() { | ||
err := solver.WorkspaceStopped(instance, workspaceMeta) |
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.
Is there a case where stopping a workspace may require a second reconcile? I'm wonder if we need an error type (or to just reuse RoutingNotReady
) to signify that a requeue is needed but no actual error occurred.
Thank you so much for the review @amisevsk . Sorry, I should've mentioned this feature is not needed for eclipse-che/che-operator#1386 anymore since a different approach was merged instead. Should I close this PR? |
@dkwon17 it's up to you -- if there's no intention of merging this PR at the moment it can be closed and re-implemented later if need be. |
Sounds good, I will close for now |
Signed-off-by: David Kwon [email protected]
What does this PR do?
Adds a
func (s *ClusterSolver) WorkspaceStopped(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta DevWorkspaceMetadata) error
method toRoutingSolver
interface. This function runs when the corresponding devworkspace has stopped.What issues does this PR fix or reference?
This PR was created to help support eclipse-che/che-operator#1386
Is it tested? How?
This branch contains the same commit as this current PR's branch, except that there is a new commit on top of it with a print statement that can be used for testing.
devworkspace-controller
namespace from the devworkspace samples:Stop the devworkspace by setting
spec.started
to false.In the output from the terminal used to run DWO from step 2, verify that the we see the print statement:
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che