-
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
Don't fail workspaces that use Kubernetes/OpenShift components with URIs #1104
Conversation
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.
Code looks good to me and works as expected on OpenShift 4.12.
Minor comment regarding documentation, but LGTM
pkg/library/kubernetes/provision.go
Outdated
@@ -34,11 +35,16 @@ import ( | |||
// Only Kubernetes/OpenShift components that are inlined are supported; components that define | |||
// a URI will cause a FailError to be returned |
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.
Documentation should be changed to ...a URI will cause a WarningError to be returned
@@ -42,7 +42,8 @@ func (h *WebhookHandler) validateKubernetesObjectPermissionsOnCreate(ctx context | |||
continue | |||
} | |||
if component.Uri != "" { | |||
return fmt.Errorf("kubenetes components specified via URI are unsupported") | |||
// We're going to ignore URI components for now |
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.
A future improvement could be to return a webhook warning (so that the dashboard could display it) but for now, I don't think this is necessary.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1104 +/- ##
==========================================
- Coverage 51.64% 51.62% -0.02%
==========================================
Files 79 79
Lines 7285 7299 +14
==========================================
+ Hits 3762 3768 +6
- Misses 3237 3243 +6
- Partials 286 288 +2
☔ View full report in Codecov by Sentry. |
Ignore Kubernetes/OpenShift-type components that define a URI, allowing such workspaces to start successfully. Instead of failing startup, add a warning to the workspace to notify the user. This helps us give at least partial compatibility with some standard devfile samples, which use currently use URIs. With this change, the workspace will at least be started (or, more accurately, partially started). Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Update the webhook server to ignore Kubernetes and OpenShift components that use URIs with deployByDefault: true. Instead these components will be ignored by DWO and a warning should be added to the workspace. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
6930146
to
0319e70
Compare
/retest |
@amisevsk do you have an already built image to test this PR? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, AObuchow, ibuziuk 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 |
I have tested with https://github.com/devfile-samples/devfile-sample-go-basic.git and I was able to start the workspace successfully. The weird thing is that my workspace pod has 3 containers (but it may be related to a dashboard issue that ignores the parent and adds a default component): NOTE: I have tested using Dev Spaces 3.6 |
I didn't build a specific image for this PR, so it was only pushed to
This should be reported as an issue on the Eclipse Che side -- it looks like something is going wrong with merging components. The |
I opened the parent issue a few weeks ago and it has been fixed Che-side but not back ported to 3.6. So yes, probably related to that. |
What does this PR do?
Update how Kubernetes/OpenShift components with URIs are handled:
deployByDefault: false
, it is ignored and workspace starts normally (the component is expected to be applied later, e.g. via an apply commanddeployByDefault: true
, it is not applied to the cluster if it uses a URI, and instead the workspace gets a warning condition. This effectively downgrades the webhook rejection to a warning conditionWhat issues does this PR fix or reference?
Closes #1103
Is it tested? How?
Apply the DevWorkspace
Update the workspace to set
deployByDefault
: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