-
Notifications
You must be signed in to change notification settings - Fork 88
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: configure DWOC from che-operator CR #1494
Conversation
Currently, only the following fields from the checluster custom resource are propagated to the DevWorkspace-Operator Configuration: - `checluster.spec.devEnvironments.Storage.pvcStrategy` - `checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.ClaimSize` - `checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.StorageClass` - `checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.ClaimSize` - `checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.StorageClass` Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Hi @AObuchow. Thanks for your PR. I'm waiting for a eclipse-che member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Codecov Report
@@ Coverage Diff @@
## main #1494 +/- ##
==========================================
+ Coverage 60.26% 60.51% +0.24%
==========================================
Files 76 77 +1
Lines 6262 6308 +46
==========================================
+ Hits 3774 3817 +43
- Misses 2125 2128 +3
Partials 363 363
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
0272fa1
to
fe6b4d1
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AObuchow, tolusha 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 |
workspaceConfig.DefaultStorageSize = &controllerv1alpha1.StorageSizes{} | ||
} | ||
|
||
pvcSize := resource.MustParse(pvc.ClaimSize) |
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.
@tolusha thank you so much for the refactor, things are looking much cleaner now.
The only issue I've found is that, since the pvc.claimSize
is a string in the CRD (and not a resource.Quantity), it's possible for resource.MustParse(pvc.ClaimSize)
to fail and cause a panic. resource.ParseQuantity()
should be used instead.
Want me to submit a fixup for this?
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 submitted the fix up. In the process I had rebased the branch which accidentally dragged some extra commits onto this PR, sorry about that. I can remove those from the PR if desired.
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.
Everything looks fine. Merge if needed.
New changes are detected. LGTM label has been removed. |
b4faf93
to
0634946
Compare
/retest |
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
0634946
to
b95e81c
Compare
@tolusha I squashed the fix up commit, should be good for merge whenever the tests complete. |
Do we need backport to 7.52.x? |
Yes 👍 |
@AObuchow: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
* feat: configure DWOC from che-operator CR Currently, only the following fields from the checluster custom resource are propagated to the DevWorkspace-Operator Configuration: - `checluster.spec.devEnvironments.Storage.pvcStrategy` - `checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.ClaimSize` - `checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.StorageClass` - `checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.ClaimSize` - `checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.StorageClass` Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com> * Update CSV and autogenerated apiv2 deepcopy Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com> * Refactoring Signed-off-by: Anatolii Bazko <abazko@redhat.com> * make fmt Signed-off-by: Anatolii Bazko <abazko@redhat.com> Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com> Signed-off-by: Anatolii Bazko <abazko@redhat.com> Co-authored-by: Anatolii Bazko <abazko@redhat.com>
Backported 0a3d57c |
@tolusha Thank you for all the help :) |
What does this PR do?
This PR adds a new reconciler which is in charge of creating and updating a DevWorkspace-Operator configuration (DWOC) in the che cluster namespace.
The intention is to propagate relevant fields from the che cluster custom resource to the DWOC.
Currently, only the following (storage related) fields are propagated from the che cluster custom resource to the DWOC:
checluster.spec.devEnvironments.Storage.pvcStrategy
checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.ClaimSize
checluster.spec.devEnvironments.Storage.perUserStrategyPvcConfig.StorageClass
checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.ClaimSize
checluster.spec.devEnvironments.Storage.perWorkspaceStrategyPvcConfig.StorageClass
The DWOC fields which can receive values from the che cluster are:
workspace.storageClassName
workspace.defaultStorageSize.common
workspace.defaultStorageSize.perWorkspace
Screenshot/screencast of this PR
n/a
What issues does this PR fix or reference?
Part of eclipse-che/che/issues/21405
How to test this PR?
There are a few automated tests that were added.
For manual testing (on minikube):
chectl server:deploy --installer operator -p minikube --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:next
kubectl edit checluster eclipse-che -n eclipse-che
15Gi
and the storage class name should be set totestName
.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.