Skip to content

Commit 980fe0e

Browse files
authored
feat (api) : Add defaultContainerResources field to CheCluster .spec.devEnvironments (#2038)
* feat (api) : Add defaultContainerResources field to CheCluster .spec.devEnvironments Signed-off-by: Rohan Kumar <[email protected]> * chore : regenerate templates after adding defaultContainerResources Signed-off-by: Rohan Kumar <[email protected]> * chore : add function merge CheCluster's defaultContainerResources to DevWorkspaceOperatorConfig Signed-off-by: Rohan Kumar <[email protected]> --------- Signed-off-by: Rohan Kumar <[email protected]>
1 parent f1d91dc commit 980fe0e

File tree

12 files changed

+501
-3
lines changed

12 files changed

+501
-3
lines changed

api/v2/checluster_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ type CheClusterDevEnvironments struct {
122122
// These default components are meant to be used when a Devfile, that does not contain any components.
123123
// +optional
124124
DefaultComponents []devfile.Component `json:"defaultComponents,omitempty"`
125+
// DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
126+
// container components that do not define limits or requests.
127+
// +optional
128+
DefaultContainerResources *corev1.ResourceRequirements `json:"defaultContainerResources,omitempty"`
125129
// Idle timeout for workspaces in seconds.
126130
// This timeout is the duration after which a workspace will be idled if there is no activity.
127131
// To disable workspace idling due to inactivity, set this value to -1.

api/v2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ metadata:
8686
categories: Developer Tools
8787
certified: "false"
8888
containerImage: quay.io/eclipse/che-operator:next
89-
createdAt: "2025-08-13T09:20:10Z"
89+
createdAt: "2025-08-28T09:40:43Z"
9090
description: A Kube-native development solution that delivers portable and collaborative
9191
developer workspaces.
9292
features.operators.openshift.io/cnf: "false"
@@ -108,7 +108,7 @@ metadata:
108108
operatorframework.io/arch.amd64: supported
109109
operatorframework.io/arch.arm64: supported
110110
operatorframework.io/os.linux: supported
111-
name: eclipse-che.v7.108.0-939.next
111+
name: eclipse-che.v7.109.0-940.next
112112
namespace: placeholder
113113
spec:
114114
apiservicedefinitions: {}
@@ -1141,7 +1141,7 @@ spec:
11411141
name: gateway-authorization-sidecar-k8s
11421142
- image: quay.io/che-incubator/header-rewrite-proxy:latest
11431143
name: gateway-header-sidecar
1144-
version: 7.108.0-939.next
1144+
version: 7.109.0-940.next
11451145
webhookdefinitions:
11461146
- admissionReviewVersions:
11471147
- v1

bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6807,6 +6807,67 @@ spec:
68076807
- name
68086808
type: object
68096809
type: array
6810+
defaultContainerResources:
6811+
description: |-
6812+
DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
6813+
container components that do not define limits or requests.
6814+
properties:
6815+
claims:
6816+
description: |-
6817+
Claims lists the names of resources, defined in spec.resourceClaims,
6818+
that are used by this container.
6819+
6820+
This is an alpha field and requires enabling the
6821+
DynamicResourceAllocation feature gate.
6822+
6823+
This field is immutable. It can only be set for containers.
6824+
items:
6825+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
6826+
properties:
6827+
name:
6828+
description: |-
6829+
Name must match the name of one entry in pod.spec.resourceClaims of
6830+
the Pod where this field is used. It makes that resource available
6831+
inside a container.
6832+
type: string
6833+
request:
6834+
description: |-
6835+
Request is the name chosen for a request in the referenced claim.
6836+
If empty, everything from the claim is made available, otherwise
6837+
only the result of this request.
6838+
type: string
6839+
required:
6840+
- name
6841+
type: object
6842+
type: array
6843+
x-kubernetes-list-map-keys:
6844+
- name
6845+
x-kubernetes-list-type: map
6846+
limits:
6847+
additionalProperties:
6848+
anyOf:
6849+
- type: integer
6850+
- type: string
6851+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6852+
x-kubernetes-int-or-string: true
6853+
description: |-
6854+
Limits describes the maximum amount of compute resources allowed.
6855+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6856+
type: object
6857+
requests:
6858+
additionalProperties:
6859+
anyOf:
6860+
- type: integer
6861+
- type: string
6862+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6863+
x-kubernetes-int-or-string: true
6864+
description: |-
6865+
Requests describes the minimum amount of compute resources required.
6866+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
6867+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
6868+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6869+
type: object
6870+
type: object
68106871
defaultEditor:
68116872
description: |-
68126873
The default editor to workspace create with. It could be a plugin ID or a URI.

config/crd/bases/org.eclipse.che_checlusters.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6761,6 +6761,67 @@ spec:
67616761
- name
67626762
type: object
67636763
type: array
6764+
defaultContainerResources:
6765+
description: |-
6766+
DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
6767+
container components that do not define limits or requests.
6768+
properties:
6769+
claims:
6770+
description: |-
6771+
Claims lists the names of resources, defined in spec.resourceClaims,
6772+
that are used by this container.
6773+
6774+
This is an alpha field and requires enabling the
6775+
DynamicResourceAllocation feature gate.
6776+
6777+
This field is immutable. It can only be set for containers.
6778+
items:
6779+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
6780+
properties:
6781+
name:
6782+
description: |-
6783+
Name must match the name of one entry in pod.spec.resourceClaims of
6784+
the Pod where this field is used. It makes that resource available
6785+
inside a container.
6786+
type: string
6787+
request:
6788+
description: |-
6789+
Request is the name chosen for a request in the referenced claim.
6790+
If empty, everything from the claim is made available, otherwise
6791+
only the result of this request.
6792+
type: string
6793+
required:
6794+
- name
6795+
type: object
6796+
type: array
6797+
x-kubernetes-list-map-keys:
6798+
- name
6799+
x-kubernetes-list-type: map
6800+
limits:
6801+
additionalProperties:
6802+
anyOf:
6803+
- type: integer
6804+
- type: string
6805+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6806+
x-kubernetes-int-or-string: true
6807+
description: |-
6808+
Limits describes the maximum amount of compute resources allowed.
6809+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6810+
type: object
6811+
requests:
6812+
additionalProperties:
6813+
anyOf:
6814+
- type: integer
6815+
- type: string
6816+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6817+
x-kubernetes-int-or-string: true
6818+
description: |-
6819+
Requests describes the minimum amount of compute resources required.
6820+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
6821+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
6822+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6823+
type: object
6824+
type: object
67646825
defaultEditor:
67656826
description: |-
67666827
The default editor to workspace create with. It could be a plugin ID or a URI.

deploy/deployment/kubernetes/combined.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,6 +6782,67 @@ spec:
67826782
- name
67836783
type: object
67846784
type: array
6785+
defaultContainerResources:
6786+
description: |-
6787+
DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
6788+
container components that do not define limits or requests.
6789+
properties:
6790+
claims:
6791+
description: |-
6792+
Claims lists the names of resources, defined in spec.resourceClaims,
6793+
that are used by this container.
6794+
6795+
This is an alpha field and requires enabling the
6796+
DynamicResourceAllocation feature gate.
6797+
6798+
This field is immutable. It can only be set for containers.
6799+
items:
6800+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
6801+
properties:
6802+
name:
6803+
description: |-
6804+
Name must match the name of one entry in pod.spec.resourceClaims of
6805+
the Pod where this field is used. It makes that resource available
6806+
inside a container.
6807+
type: string
6808+
request:
6809+
description: |-
6810+
Request is the name chosen for a request in the referenced claim.
6811+
If empty, everything from the claim is made available, otherwise
6812+
only the result of this request.
6813+
type: string
6814+
required:
6815+
- name
6816+
type: object
6817+
type: array
6818+
x-kubernetes-list-map-keys:
6819+
- name
6820+
x-kubernetes-list-type: map
6821+
limits:
6822+
additionalProperties:
6823+
anyOf:
6824+
- type: integer
6825+
- type: string
6826+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6827+
x-kubernetes-int-or-string: true
6828+
description: |-
6829+
Limits describes the maximum amount of compute resources allowed.
6830+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6831+
type: object
6832+
requests:
6833+
additionalProperties:
6834+
anyOf:
6835+
- type: integer
6836+
- type: string
6837+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6838+
x-kubernetes-int-or-string: true
6839+
description: |-
6840+
Requests describes the minimum amount of compute resources required.
6841+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
6842+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
6843+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6844+
type: object
6845+
type: object
67856846
defaultEditor:
67866847
description: |-
67876848
The default editor to workspace create with. It could be a plugin ID or a URI.

deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6777,6 +6777,67 @@ spec:
67776777
- name
67786778
type: object
67796779
type: array
6780+
defaultContainerResources:
6781+
description: |-
6782+
DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
6783+
container components that do not define limits or requests.
6784+
properties:
6785+
claims:
6786+
description: |-
6787+
Claims lists the names of resources, defined in spec.resourceClaims,
6788+
that are used by this container.
6789+
6790+
This is an alpha field and requires enabling the
6791+
DynamicResourceAllocation feature gate.
6792+
6793+
This field is immutable. It can only be set for containers.
6794+
items:
6795+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
6796+
properties:
6797+
name:
6798+
description: |-
6799+
Name must match the name of one entry in pod.spec.resourceClaims of
6800+
the Pod where this field is used. It makes that resource available
6801+
inside a container.
6802+
type: string
6803+
request:
6804+
description: |-
6805+
Request is the name chosen for a request in the referenced claim.
6806+
If empty, everything from the claim is made available, otherwise
6807+
only the result of this request.
6808+
type: string
6809+
required:
6810+
- name
6811+
type: object
6812+
type: array
6813+
x-kubernetes-list-map-keys:
6814+
- name
6815+
x-kubernetes-list-type: map
6816+
limits:
6817+
additionalProperties:
6818+
anyOf:
6819+
- type: integer
6820+
- type: string
6821+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6822+
x-kubernetes-int-or-string: true
6823+
description: |-
6824+
Limits describes the maximum amount of compute resources allowed.
6825+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6826+
type: object
6827+
requests:
6828+
additionalProperties:
6829+
anyOf:
6830+
- type: integer
6831+
- type: string
6832+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6833+
x-kubernetes-int-or-string: true
6834+
description: |-
6835+
Requests describes the minimum amount of compute resources required.
6836+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
6837+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
6838+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
6839+
type: object
6840+
type: object
67806841
defaultEditor:
67816842
description: |-
67826843
The default editor to workspace create with. It could be a plugin ID or a URI.

0 commit comments

Comments
 (0)