Skip to content
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 populate devworkspace.status.message with info about failures #239

Closed
wants to merge 4 commits into from

Conversation

amisevsk
Copy link
Collaborator

@amisevsk amisevsk commented Jan 8, 2021

What does this PR do?

  1. Update dependency to latest commit in devfile/api
  2. Update samples to follow updated devfile/api spec (restrictions on command.id formatting)
  3. Update webhooks to specify that they have no side-effects
    • This probably could be a separate PR, but it's a minor change I realized we needed while testing our samples. Note that v1 webhooks support only None and NoneOnDryRun.
  4. Propagate the message from any "FailedStart" or "Error" condition to devworkspace.status.message. Error overrides FailedStart if both happen to be present (they should never be)

What issues does this PR fix or reference?

Closes #232

Is it tested? How?

Before testing, it's necessary to run make update_devworkspace_crds to the latest devfile/api CRDs (and make install to deploy them).

Easiest to test on minikube:

$ kubectl apply -f samples/theia-next.yaml
$ kubectl apply -f samples/web-terminal.yaml
# wait a bit...
$ kubectl get dw

NAME           WORKSPACE ID                PHASE     INFO                                                          URL
theia          workspace8af91dfdf1f1417f   Running                                                                 http://workspace8af91dfdf1f1417f-theia-3100.192.168.49.2.nip.io
web-terminal   workspace32d4b43e65e64e64   Failed    Failed to install network objects required for devworkspace   

We should probably move INFO to be the last column

Additional info

Kubernetes docs on webhooks with side effects: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#side-effects

* 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 <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
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 <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@sleshchenko
Copy link
Member

/test v5-devworkspaces-operator-e2e

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested but changes LGTM

Copy link
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ideally INFO would be in the last column but LGTM

@openshift-ci-robot
Copy link
Collaborator

[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
Copy link
Collaborator Author

I think ideally INFO would be in the last column but LGTM

I agree, but it'll look ugly no matter how we do it -- WDYT about potentially combining URL and INFO? If a workspace starts correctly, it's populated by the URL where you can access it, otherwise it's populated with an info message.

cc: @davidfestal

@JPinkney
Copy link
Contributor

WDYT about potentially combining URL and INFO?

Personally, I like the idea. It would keep the output a lot shorter and easier to manage on a terminal. Aren't showing a URL and INFO technically mutually exclusive anyway? Or is there a case that a URL will show when INFO is set as well?

@davidfestal
Copy link
Collaborator

WDYT about potentially combining URL and INFO?

Even now you don't show in the column the same name as in the status field: INFO v Message

So if kubebuilder:printcolumn would allow combining 2 status fields, I'm not against combining both ideURL and message fields.

@amisevsk
Copy link
Collaborator Author

amisevsk commented Jan 18, 2021

@davidfestal I was thinking of removing ideUrl from printColumns and repurposing message to show the URL to the user; ideUrl would still be around for API uses. That way we still have all the functionality and a cleaner interface for users.

@openshift-ci-robot
Copy link
Collaborator

@amisevsk: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sleshchenko
Copy link
Member

@davidfestal I was thinking of removing ideUrl from printColumns and repurposing message to show the URL to the user; ideUrl would still be around for API uses. That way we still have all the functionality and a cleaner interface for users.

I'm OK with the proposed change.
And it should not be an issue if we hide URL for stopped or failed DevWorkspace. It may be even better since this URL gives 503 and user may reconfigure routing before start.

@amisevsk
Copy link
Collaborator Author

amisevsk commented Feb 3, 2021

Putting this one on hold as I'd like to include devfile/api#335, at which point we should bring in at least devfile/api#324 as well.

@sleshchenko
Copy link
Member

Seems it's a time to update the PR or close it )

@amisevsk
Copy link
Collaborator Author

Seems it's a time to update the PR or close it )

I never thought an 80 line change could conflict with so many files :D

I'll create a new PR since we need to update the devfile/api dependency again

@amisevsk amisevsk closed this Feb 16, 2021
@amisevsk amisevsk deleted the devworkspace-status-message branch February 8, 2023 15:46
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.

Populate devworkspace.status.message with info about failures
5 participants