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

Add devWorkspace.runningLimit field to CheCluster schema #1335

Closed
wants to merge 1 commit into from

Conversation

olexii4
Copy link
Contributor

@olexii4 olexii4 commented Mar 11, 2022

Signed-off-by: Oleksii Orel oorel@redhat.com

What does this PR do?

Add devWorkspace.runningLimit field into CheCluster schema:

                    runningLimit:
                      description: Defined quantity maximal running workspaces per user.
                      type: number

Screenshot/screencast of this PR

You can test it with Dashboard swagger ${CHE_HOST}/dashboard/api/swagger/static/index.html#/clusterConfig/get_dashboard_api_cluster_config
2022-03-14_12_14_09

What issues does this PR fix or reference?

fixes eclipse-che/che#21032

How to test this PR?

To deploy:
Can be tested by following these steps: https://github.com/eclipse-che/che-operator#deploy-che-operator-with-chectl-using---installer-operator-flag

I have tested it with platform minikube and this che-operator image: docker.io/olexii4dockerid/che-operator:next.

Example:

chectl server:deploy \
    --installer=operator \
    --platform=minikube \
    --che-operator-image=docker.io/olexii4dockerid/che-operator:next
  1. Deploy Eclipse-CHE with operator-image docker.io/olexii4dockerid/che-operator:next.
  2. Pach checlusters/eclipse-che with command
kubectl patch checlusters/eclipse-che --patch "{\"spec\":{\"devWorkspace\":{\"runningLimit\":2}}}" -n eclipse-che --type=merge
  1. Open ${CHE_HOST}/dashboard/api/swagger and get clusterConfig. The running limit should be 2.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@openshift-ci
Copy link

openshift-ci bot commented Mar 11, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olexii4

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olexii4 olexii4 requested a review from ibuziuk March 11, 2022 13:59
Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

Let's use spec.devworkspace.runningLimit - eclipse-che/che-dashboard#475 (comment)

@ibuziuk
Copy link
Member

ibuziuk commented Mar 11, 2022

I believe you need to change api/v1/checluster_types.go https://github.com/eclipse-che/che-operator#checluster-custom-resource and then run make update-resources -s

@olexii4 olexii4 changed the title Add server.runningLimit field to CheCluster schema Add devWorkspace.runningLimit field to CheCluster schema Mar 11, 2022
Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

@tolusha
Copy link
Contributor

tolusha commented Mar 14, 2022

The correct way to add new fields to CheCluster CRD is:

  1. Update https://github.com/eclipse-che/che-operator/blob/main/api/v1/checluster_types.go
  2. Run make update-resources
  3. Commit all changes

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #1335 (db4cdc2) into main (e78b0be) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1335   +/-   ##
=======================================
  Coverage   60.52%   60.52%           
=======================================
  Files          77       77           
  Lines        6346     6346           
=======================================
  Hits         3841     3841           
  Misses       2119     2119           
  Partials      386      386           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e78b0be...db4cdc2. Read the comment docs.

@ibuziuk
Copy link
Member

ibuziuk commented Mar 15, 2022

@olexii4 @tolusha folks, I opened #1338 in favour of this PR. WDYT can we close this one and review #1338 instead?

@tolusha tolusha closed this Mar 15, 2022
@tolusha tolusha deleted the CHE-21032 branch January 19, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable single running workspace restriction for DevWorkspaces started from UD
3 participants