Workbench Job template produces invalid YAML for long working directories containing spaces

Aperta Adatta ai principianti
#969 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #970 di @bcpierson-lilly — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
yaml
Ambito
build-system

Direzione di ricerca

Inizia con l’espressione di rendering workingDir del modello Workbench Job e confrontala con il pattern simile di indent e trimPrefix citato nel commit 1986ad36. Esegui il rendering del modello con il lungo percorso sintetico con spazi indicato nell’issue, quindi verifica che l’output possa essere analizzato come YAML e mantenga esattamente la stringa della directory.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

team: launcher team: workbench

Description

The Workbench Job template renders workingDir with toYaml but does not indent continuation lines. When serialization wraps a long path at spaces, the generated YAML is invalid and Kubernetes rejects the Job before execution. I reproduced this with rstudio-workbench chart 0.21.5, template version 2.5.0, and Workbench 2026.07.1-ubuntu-24.04. The current upstream template also contains the affected expression.

Reproduction details

Submit an audited job using /usr/bin/true and this synthetic working directory:

/home/example/a long directory with enough spaces to exercise wrapping at the serializer line width - continuation looks like a YAML list

The directory doesn't need to exist to actually reproduce the YAML rejection, the error occurs before container startup.

Observed results:

  • A short working directory and a 154-character path without spaces both launched successfully.
  • A long path containing spaces returned HTTP 500 with Kubernetes API failure.
    • Launcher logs showed Kubernetes HTTP 400 with a YAML parsing error. The reported line number varies with the rendered document.

Suggested correction

gotemplate
workingDir: {{ toYaml .Job.workingDirectory | indent 12 | trimPrefix (repeat 12 " ") }}

Local rendering tests with this correction produced valid YAML and preserved the exact directory string. A similar fix with the same indent / trimPrefix pattern was applied to other fields in commit 1986ad36.

Lingua principale
Markdown
Stelle
46
Fork
39
Merge medio
16h 27m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rstudio/helm

Tutte le issue di rstudio/helm

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.