-
Notifications
You must be signed in to change notification settings - Fork 61
Implement support for Volume components #237
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
Conversation
/retest |
locally tests fail with error |
Fixed in fd0b0f1 -- forgot to update e2e tests to accomodate the changes :) |
313fa71
to
0db22b0
Compare
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.
LGTM, I also tried it out and everything seemed to be working as expected for me
Add tests for library code (:tada: :tada: :tada:)
🎉 🎉 🎉 🎉 🎉 🎉
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, JPinkney 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 |
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.
Nothing major is found in the code. Proceeding to testing.
I ran |
@sleshchenko It looks like the RBAC issue came from commit a7db052 -- we add a couple of lines to role.yaml but not the annotations needed to generate them. I'll fixup. |
New changes are detected. LGTM label has been removed. |
5c6e94d
to
993c1bf
Compare
Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
/test v5-devworkspaces-operator-e2e |
2 similar comments
/test v5-devworkspaces-operator-e2e |
/test v5-devworkspaces-operator-e2e |
/test v5-devworkspaces-operator-e2e |
Move files in pkg/library to pkg/library/lifecycle to make adding more library functions cleaner. Signed-off-by: Angel Misevski <[email protected]>
Add library function GetKubeContainersFromDevfile to convert container components in a flattened devfile into k8s Container objects. Signed-off-by: Angel Misevski <[email protected]>
Add library function RewriteContainerVolumeMounts that converts containers and initContainers VolumeMounts to use a common PVC. Signed-off-by: Angel Misevski <[email protected]>
Add package pkg/library/shim which is used to reconstruct ComponentMetadata as required by che-rest-apis (which is in turn required by Che-Theia). This package is necessary as a shim between purely devfile 2.0 devworkspaces and current devworkspaces, which use devfile 1.0 concepts (plugin meta.yaml, Theia's dependence on Che server, etc.). Eventually this library should be deprecated. Signed-off-by: Angel Misevski <[email protected]>
Replace usage of Component subresource with straight conversion of devfile components to k8s objects. This commit disables support for un-flattened devfiles (i.e. devfiles that contain parents or plugins). For flattened devfiles, functionality is identical. Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
- Add documentation to various methods as library functions deal with more edge cases - Split package pkg/library/container into multiple files for readability - Improve handling of mountSources to respect sourceMapping, correctly define projects volume - Improve common PVC provisioning to not add PVC if not needed Signed-off-by: Angel Misevski <[email protected]>
- Only set storage finalizer on workspace if workspace needs storage as defined by storage library - Only generate and sync PVC if workspace needs storage Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
Need to make sure we only add each exposed port once on a container Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
This avoids an issue where a container can mount the projects volume directly and have `mountSources: true`, which results in a duplicate mount and invalid deployment. Related to issue devfile/api#290 and how projects volume should be handled with `mountSources`. Signed-off-by: Angel Misevski <[email protected]>
Improve check for whether the volumeMount subpaths workaround is required for a particular deployment. Previously, we only checked whether any volumes were defined, which failed on OpenShift due to a secret volume being in the list. Now we check to make sure the common PVC volume is present in the deployment before applying the workaround. Signed-off-by: Angel Misevski <[email protected]>
Machine exec depends on the CHE_MACHINE_NAME plugin to find the right container to exec into. Add a function for populating env vars to the shim library. Signed-off-by: Angel Misevski <[email protected]>
568da95
to
ce39b26
Compare
/test v5-devworkspaces-operator-e2e |
/retest |
I've tested our usual flows on |
What does this PR do?
This PR is the first part of a (probably 3-part) series in removing remaining devfile 1.0 functionality from the controller.
It's a fairly significant departure in flow: the Component reconciler is disabled (and will be removed in the next PR). Instead we use libraries to resolve container and volume components directly. This changes how storage is provisioned for a workspace and makes it clearer where this happens (now: happens right after components are processed, as opposed to before, where it would happen during Deployment provisioning).
Note: Only flattened (i.e. no plugins, no parents) DevWorkspaces are supported as of this PR. This functionality will be re-added soon in a separate PR.
There are some TODOs left in the code, largely for tasks which are out of scope for now (they are labelled
TODO#185
to reference the issue this PR closes), and TODOs on package docs for ambiguities in the devfile API spec; these reference issues in devfile/api where appropriate.Short summary of changes
flattened_*
)The commit history should be fairly linear with self-explanatory commit messages; except for commit c6cbe19 which does some refactoring to better support kind of subtle mountSources functionality.
Next PRs will feature:
What issues does this PR fix or reference?
Closes #185
Is it tested? How?
Tested on minikube. Since this PR disables support for unflattened devfiles, new files are provided in the samples directory for testing (they are prefixed with
flattened_
).