Skip to content

dwoc-custom-init-containers#12

Open
akurinnoy wants to merge 10 commits into
mainfrom
supervisor/54e4cf33-4920-4e10-b9e8-2320486d3435
Open

dwoc-custom-init-containers#12
akurinnoy wants to merge 10 commits into
mainfrom
supervisor/54e4cf33-4920-4e10-b9e8-2320486d3435

Conversation

@akurinnoy

Copy link
Copy Markdown
Owner

Summary

Automated implementation via supervisor execution pipeline.

Run ID: 54e4cf33-4920-4e10-b9e8-2320486d3435
Plan ID: dwoc-custom-init-containers
Waves completed: 4/4

Tasks

  • T1: Clone repo, verify build, and map existing implementation gaps
  • T2: Add command validation to EnsureHomeInitContainerFields
  • T3: Add unit tests for command validation and multiple custom init containers
  • T4: Add YAML fixture tests for backward compatibility and ephemeral-storage path
  • T5: Run full test suite and create PR

Integration Waves

  • Wave 1: merged T1
  • Wave 2: merged T2
  • Wave 3: merged T3, T4
  • Wave 4: merged T5

akurinnoy and others added 10 commits June 29, 2026 20:51
Verified baseline build and tests pass on HEAD cdc8050. Mapped exact
line numbers for EnsureHomeInitContainerFields (persistentHome.go:252-262),
the controller call site (devworkspace_controller.go:435-441), and
documented all existing command validation gaps for T2/T3.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Reject a custom init-persistent-home container whose Command is non-empty
and not exactly ["/bin/sh", "-c"]. Uses reflect.DeepEqual for comparison.
Returns: "Invalid init-persistent-home container: command must be exactly [/bin/sh, -c]"

Update controller call site to surface the error message directly via
r.failWorkspace(err.Error()) without wrapping prefix.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…WOC init containers

- Add table-driven tests for EnsureHomeInitContainerFields covering:
  empty command (gets default /bin/sh -c), valid command accepted unchanged,
  /bin/bash -c rejected with exact error message, /bin/sh without -c rejected
- Add VolumeMounts assertion tests verifying persistent-home mount on /home/user/
- Add full-flow tests verifying two non-init-persistent-home DWOC containers
  appear after init-persistent-home and order is preserved
- Add MergeInitContainers test verifying new-named patch container is appended

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…e path

Add three new YAML fixture files for TestPersistentHomeVolume:

- no-dwoc-init-containers.yaml: verifies that when no DWOC initContainers
  are configured, the default stow-based init-persistent-home devfile
  component is added (backward compatibility path).

- dwoc-override-init-persistent-home.yaml: verifies that when DWOC
  specifies init-persistent-home with only args (no command field), the
  devfile TemplateSpec still receives the default stow-based init component
  via AddPersistentHomeVolume. No volumeMounts or corev1.Container fields
  are asserted in the DWOC initContainers input.

- ephemeral-with-init-persistent-home-in-dwoc.yaml: verifies that
  NeedsPersistentHomeDirectory returns true for ephemeral storage when
  init-persistent-home is configured in DWOC, causing AddPersistentHomeVolume
  to be called and add the persistent-home volume.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.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.

1 participant