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 spec.devEnvironments.runtimeClassName field to CR #1899

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

dkwon17
Copy link
Contributor

@dkwon17 dkwon17 commented Sep 16, 2024

What does this PR do?

Fixes eclipse-che/che#23032

Screenshot/screencast of this PR

What issues does this PR fix or reference?

How to test this PR?

  1. Deploy the operator:

OpenShift

./build/scripts/olm/test-catalog-from-sources.sh

on Minikube

./build/scripts/minikube-tests/test-operator-from-sources.sh
  1. Create a custom runtime class:
kind: RuntimeClass
apiVersion: node.k8s.io/v1
metadata:
  name: my-custom-runtime
handler: runc
  1. Start a workspace and verify that the workspace pod does not have spec.runtimeClassName field.
  2. Stop the workspace
  3. In the CheCluster CR, set spec.devEnvironments.runtimeClassName field to my-custom-runtime
  4. Start the workspace from step 4.
  5. Verify that the workspace pod has the spec.runtimeClassName filed set to my-custom-runtime

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.

Copy link

openshift-ci bot commented Sep 16, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dkwon17 dkwon17 changed the title Runtimeclassname Add spec.devEnvironments.runtimeClassName field to CR Sep 16, 2024
@@ -155,6 +155,9 @@ type CheClusterDevEnvironments struct {
// If not specified, the pod scheduler is set to the default scheduler on the cluster.
// +optional
PodSchedulerName string `json:"podSchedulerName,omitempty"`
// RuntimeClassName specifies the spec.runtimeClassName for workspace pods.
// +optional
RuntimeClassName *string `json:"runtimeClassName,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've set the type to *string because that is the type for RuntimeClassName in PodSpec struct:

https://github.com/kubernetes/api/blob/9dc1a952bda9aeb400aa6409b7d89eff50d6ea77/core/v1/types.go#L3920

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe PodRuntimeClassName ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMHO I don't know if it's necessary since we have names such as:

// The node selector limits the nodes that can run the workspace pods.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// The pod tolerations of the workspace pods limit where the workspace pods can run.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

@dkwon17 dkwon17 marked this pull request as ready for review September 18, 2024 00:10
Copy link

openshift-ci bot commented Sep 18, 2024

@dkwon17: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v14-che-behind-proxy 813dcbf link true /test v14-che-behind-proxy

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-sigs/prow repository. I understand the commands that are listed here.

Copy link

openshift-ci bot commented Sep 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dkwon17, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dkwon17 dkwon17 merged commit 4bacfff into eclipse-che:main Sep 19, 2024
18 of 19 checks passed
@devstudio-release
Copy link

Build 3.17 :: operator_3.x/401: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.17 :: operator_3.x/401: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/7719 triggered

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.17 :: sync-to-downstream_3.x/7720: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/7712 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devstudio-release
Copy link

Build 3.17 :: operator-bundle_3.x/3617: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/7720 triggered

@devstudio-release
Copy link

Build 3.17 :: copyIIBsToQuay/2796: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.17 :: dsc_3.x/2003: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.17 :: update-digests_3.x/7580: SUCCESS

Detected new images: rebuild operator-bundle
* devspaces-operator; /DS_CI/operator-bundle_3.x/3617 triggered

@devstudio-release
Copy link

Build 3.17 :: dsc_3.x/2003: SUCCESS

3.17.0-CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In the Che CR provide a way to set the runtime class for all CDE pods
3 participants