-
Notifications
You must be signed in to change notification settings - Fork 60
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
Update devfile/api dependency and message with info about failures #270
Conversation
* Update Makefile to point at latest devfile/api commit and support v2 * Update to devfile/api commit f33d2987d137225cd1e8975f6fdfdd2663195a37 * Adapt code to support new module name (.../v2) (see: devfile/api#280) Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
By default, webhooks get an "unknown" side effects field, which prevents dry-runs on involved resources. Instead we set side-effects to "none" to re-enable dry runs. Note: side-effects in this context refers to changes outside the context of the AdmissionReview that is submitted. Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
Some CRDs reuse types from devfile/api so they need to be regenerated after updating Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[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.
The PR LGTM and improves a lot UX.
I have a proposal for another improvement, maybe we should report the progressing condition into INFO, like the following:
//conditionOrders contains ordered conditions in way the should become ready
// first not ready should be propagated to info
var conditionOrders = map[devworkspace.WorkspaceConditionType]string {
devworkspace.WorkspaceComponentsReady: "Waiting for components",
devworkspace.WorkspaceServiceAccountReady: "Waiting for service account",
devworkspace.WorkspaceRoutingReady: "Waiting for routing",
//devworkspace.WorkspaceDeploymentReady
//devworkspace.WorkspaceIDEReady
}
func getInfoMessage(workspace *devworkspace.DevWorkspace, conditions map[devworkspace.WorkspaceConditionType]string) string {
var failedStartMsg string
for conditionType, conditionMessage := range conditions {
switch conditionType {
// Take error condition message as overriding failed start message
case devworkspace.WorkspaceError:
return conditionMessage
case devworkspace.WorkspaceFailedStart:
failedStartMsg = conditionMessage
case devworkspace.WorkspaceReady:
return workspace.Status.IdeUrl
}
}
if failedStartMsg != "" {
return failedStartMsg
}
for conditionType, progress := range conditionOrders {
if _, present := conditions[conditionType]; !present {
return progress
}
}
return workspace.Status.IdeUrl
}
^ it's not tested
@@ -43,7 +43,7 @@ func handleMountSources(k8sContainer *corev1.Container, devfileContainer *devwor | |||
var sourceMapping string | |||
if vm := getProjectsVolumeMount(k8sContainer); vm != nil { | |||
// Container already mounts projects volume; need to set env vars according to mountPath | |||
// TODO: see issue https://github.com/devfile/api/issues/290 | |||
// TODO: see issue https://github.com/devfile/api/v2/issues/290 |
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 suspect you used find/replace :-D
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'll admit to a non-judicious use of sed
here.
controllers/workspace/status.go
Outdated
if failedStartMsg != "" { | ||
return failedStartMsg | ||
} | ||
return workspace.Status.IdeUrl |
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.
Should we return IdeURL when it's not ready yet?
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's what we currently do -- personally I like it because I can copy it and refresh a few times to load a workspace, rather than repeatedly using kubectl get
, but I'm happy to do it either way (and with your suggestion above of reporting latest condition, it makes sense to not put ideURL until it's started anyways)
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.
Probably it's another issue, but I saw we return outdated URL, after routing class is changed but workspace is stopped.
and with proposal to report the latest condition, I just wondered how we can avoid confusion we got when workspace is started but not started, because Che Routing is not available yet.
There we may also report finalizing a workspace, currently the way is to check removal timestamp )
/test v5-devworkspaces-operator-e2e |
pkg/library/storage/commonStorage.go
Outdated
@@ -18,8 +18,8 @@ | |||
// - Devfile API spec is unclear on how mountSources should be handled -- mountPath is assumed to be /projects | |||
// and volume name is assumed to be "projects" | |||
// see issues: | |||
// - https://github.com/devfile/api/issues/290 | |||
// - https://github.com/devfile/api/issues/291 | |||
// - https://github.com/devfile/api/v2/issues/290 |
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 think this might be another find and replace error 😉
[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:
Approvers can indicate their approval by writing |
Signed-off-by: Angel Misevski <[email protected]>
New changes are detected. LGTM label has been removed. |
/test v5-devworkspaces-operator-e2e |
Update status message to show "Stopping"/"Stopped" when a workspace is stopped, and "Cleaning up resources for deletion" when we're waiting on a finalizer to be cleared. Signed-off-by: Angel Misevski <[email protected]>
Added support for |
/test v5-devworkspaces-operator-e2e |
What does this PR do?
Update the devfile/api dependency to latest 283b0c54946e9fea9872c25e1e086c303688f0e8, including a fix for the new package path (see: devfile/api#280)
Add support for propagating status info to devworkspace status, reusing the
message
field, now thatideUrl
has been removed from printColumns:What issues does this PR fix or reference?
Closes #232
Is it tested? How?
Test usual flows, functionality should not be changed except for messages
cc: @metlos I suspect you will also have to update your code to adapt to devfile/api#280