Skip to content

fix(config): bump default persistent home init container memory limit…#1644

Open
btjd wants to merge 1 commit into
devfile:mainfrom
btjd:CRW-10734
Open

fix(config): bump default persistent home init container memory limit…#1644
btjd wants to merge 1 commit into
devfile:mainfrom
btjd:CRW-10734

Conversation

@btjd

@btjd btjd commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR addresses issue CRW-10734 by increasing the default memory allocations assigned to the init-persistent-home container.

The previous default threshold of 128Mi was causing transient Out-Of-Memory (OOM) faults (Exit Code 137) during initialization when deploying workspaces utilizing heavy developer images (such as the Universal Developer Image), due to the volume of file-stowing operations. Right-sizing the fallback bounds prevents container termination while preserving user override flexibility via custom operator configs.

Technical Changes

  • Updated pkg/config/defaults.go to shift default init-persistent-home resource settings to 256Mi (limit) and 128Mi (request).
  • Generated updated structural deepcopy and manifest CRD assets (make generate).

Validation Performed

  • Verified local standalone operator validation execution lifecycle.
  • Tested Scenario A: Confirmed clean baseline generation (256Mi memory bounds injected, execution completed with Exit Code 0).
  • Tested Scenario B: Verified manual cluster configuration properties inside DevWorkspaceOperatorConfig supersede defaults without regression.

AI Assistance Disclosure

  • Assisted-by: Claude
  • Details: AI was utilized for execution log analytics, local target pathway troubleshooting, and runtime cluster validation workflows. The baseline source code modifications consist strictly of configuration constant updates.

Summary by CodeRabbit

  • Chores
    • Increased default container memory resource allocations: memory limits updated from 128Mi to 256Mi, and memory requests from 64Mi to 128Mi
    • Applied updates consistently across all configuration defaults, CRD specifications, and deployment manifests
    • Ensures improved resource allocation for containers without explicit memory configuration

@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: btjd
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 53f60d9d-9638-48fd-8838-787a28c8a7fa

📥 Commits

Reviewing files that changed from the base of the PR and between cca19c4 and cc15c73.

📒 Files selected for processing (8)
  • apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go
  • deploy/bundle/manifests/controller.devfile.io_devworkspaceoperatorconfigs.yaml
  • deploy/deployment/kubernetes/combined.yaml
  • deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml
  • deploy/deployment/openshift/combined.yaml
  • deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml
  • deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml
  • pkg/config/defaults.go
✅ Files skipped from review due to trivial changes (7)
  • apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go
  • pkg/config/defaults.go
  • deploy/deployment/kubernetes/combined.yaml
  • deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml
  • deploy/bundle/manifests/controller.devfile.io_devworkspaceoperatorconfigs.yaml
  • deploy/deployment/openshift/combined.yaml
  • deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml

📝 Walkthrough

Walkthrough

Default container memory limits are increased from 128Mi to 256Mi and memory requests from 64Mi to 128Mi in pkg/config/defaults.go. The corresponding inline Go documentation comment and all CRD schema description strings across Kubernetes and OpenShift deployment manifests are updated to match.

Changes

Default Memory Resource Update

Layer / File(s) Summary
Core default values and API type docs
pkg/config/defaults.go, apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go
defaultConfig.Workspace.DefaultContainerResources memory Limits changed to 256Mi and Requests to 128Mi; the Go struct field comment updated to match.
CRD schema descriptions
deploy/templates/crd/bases/...yaml, deploy/bundle/manifests/...yaml, deploy/deployment/kubernetes/..., deploy/deployment/openshift/...
All CRD OpenAPI schema description strings for defaultContainerResources updated to report 256Mi/128Mi as the default memory limit/request.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop hop, more memory today,
From 128 to 256 we say!
The containers grow strong,
The requests tag along,
A doubling of RAM on the way! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: bumping default memory limits for the persistent home init container from 128Mi to 256Mi.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tolusha

tolusha commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant help — Show this help message

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pkg/config/defaults.go (2)

2-2: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update copyright year to 2026 in pkg/config/defaults.go and apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go.

Both files show copyright year 2025 in their headers, but the current year is 2026. As per coding guidelines, all Go source files must start with the copyright header format: // Copyright (c) 2019-2026 Red Hat, Inc. The same one-line fix applies to both files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/config/defaults.go` at line 2, Replace the outdated header line "//
Copyright (c) 2019-2025 Red Hat, Inc." with "// Copyright (c) 2019-2026 Red Hat,
Inc." in both files that show this header (identify by that exact header string)
so the file headers in pkg/config/defaults.go and
apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go are updated to
2026.

Source: Coding guidelines


18-27: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reorganize imports to follow project conventions.

The imports are not organized according to the coding guidelines. As per coding guidelines, imports should be organized into three groups separated by blank lines: (1) standard library, (2) third-party + Kubernetes, (3) project-local. Currently, the project-local imports appear before the Kubernetes packages.

♻️ Proposed fix - Run 'make fmt' to automatically fix
 import (
 	"fmt"
 
-	"github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
-	"github.com/devfile/devworkspace-operator/pkg/infrastructure"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
 	"k8s.io/utils/pointer"
+
+	"github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
+	"github.com/devfile/devworkspace-operator/pkg/infrastructure"
 )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/config/defaults.go` around lines 18 - 27, Reorder the import block in
pkg/config/defaults.go into three groups separated by blank lines—first standard
library (fmt), then third-party/Kubernetes packages (k8s.io/* and
k8s.io/utils/pointer), and finally project-local imports
(github.com/devfile/devworkspace-operator/... and
github.com/devfile/devworkspace-operator/pkg/infrastructure); ensure imports for
appsv1, corev1, and k8s resource/pointer are in the Kubernetes group and
devworkspace/infrastructure are in the project-local group, then run the
repository formatter (make fmt) to apply the style automatically.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml`:
- Line 544: The generated CRD artifact is out of sync with the updated template:
update the default memory description from "128Mi/64Mi" to "256Mi/128Mi" in the
deployed CRD by regenerating the CRD objects from the source template
(controller.devfile.io_devworkspaceoperatorconfigs.yaml) and committing the
updated
devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml;
run the project’s CRD generation/make target (or the generator script used by
the repo), verify the memory default strings now read "256Mi" (limit) and
"128Mi" (request) in the generated CRD, and commit the regenerated file so both
files advertise the same defaults.

---

Outside diff comments:
In `@pkg/config/defaults.go`:
- Line 2: Replace the outdated header line "// Copyright (c) 2019-2025 Red Hat,
Inc." with "// Copyright (c) 2019-2026 Red Hat, Inc." in both files that show
this header (identify by that exact header string) so the file headers in
pkg/config/defaults.go and
apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go are updated to
2026.
- Around line 18-27: Reorder the import block in pkg/config/defaults.go into
three groups separated by blank lines—first standard library (fmt), then
third-party/Kubernetes packages (k8s.io/* and k8s.io/utils/pointer), and finally
project-local imports (github.com/devfile/devworkspace-operator/... and
github.com/devfile/devworkspace-operator/pkg/infrastructure); ensure imports for
appsv1, corev1, and k8s resource/pointer are in the Kubernetes group and
devworkspace/infrastructure are in the project-local group, then run the
repository formatter (make fmt) to apply the style automatically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3953d8f2-a3f0-4068-a305-4777b6d82c96

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6ff69 and 2df07fa.

📒 Files selected for processing (4)
  • apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go
  • apis/controller/v1alpha1/zz_generated.deepcopy.go
  • deploy/templates/crd/bases/controller.devfile.io_devworkspaceoperatorconfigs.yaml
  • pkg/config/defaults.go

// DefaultContainerResources defines the resource requirements (memory/cpu limit/request) used for
// container components that do not define limits or requests. In order to not set a field by default,
// the value "0" should be used. By default, the memory limit is 128Mi and the memory request is 64Mi.
// the value "0" should be used. By default, the memory limit is 256Mi and the memory request is 128Mi.

@rohanKanojia rohanKanojia Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since you've modified CRD types you'd need to run this command so that changes are reflected in deploy/ manifests:

make generate_all

You don't need to manually modify deepcopy.go or any files in deploy/. When I ran the above-mentioned command, i saw these files being modified:

        modified:   apis/controller/v1alpha1/zz_generated.deepcopy.go
        modified:   deploy/bundle/manifests/controller.devfile.io_devworkspaceoperatorconfigs.yaml
        modified:   deploy/deployment/kubernetes/combined.yaml
        modified:   deploy/deployment/kubernetes/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml
        modified:   deploy/deployment/openshift/combined.yaml
        modified:   deploy/deployment/openshift/objects/devworkspaceoperatorconfigs.controller.devfile.io.CustomResourceDefinition.yaml

Comment thread apis/controller/v1alpha1/zz_generated.deepcopy.go Outdated
@btjd

btjd commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

/retest

…s to 256Mi

Signed-off-by: Badre Tejado-Imam <btejado@redhat.com>
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.

3 participants