Kubernetes Operator for Tangled Spindles

fix PATH

evan.jarrett.net f85e5578 af50a0b3

verified
+5 -4
-1
internal/engine/kubernetes_engine.go
··· 132 132 // Set engine-specific environment variables on the workflow 133 133 // These will be merged with pipeline env vars by the framework 134 134 workflowEnv := map[string]string{ 135 - "PATH": "/runner-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 136 135 "TANGLED_ARCHITECTURE": spec.Architecture, 137 136 } 138 137
+5 -3
internal/jobbuilder/job_template.go
··· 279 279 }, 280 280 281 281 // Main container: run loom-runner binary in user's image 282 + // Use shell to prepend /runner-bin to PATH, preserving the image's PATH 282 283 Containers: []corev1.Container{ 283 284 { 284 285 Name: "runner", 285 286 Image: config.Image, 286 - Command: []string{"/runner-bin/loom-runner"}, 287 + Command: []string{"/bin/sh", "-c", "export PATH=/runner-bin:$PATH && exec /runner-bin/loom-runner"}, 287 288 WorkingDir: "/tangled/workspace", 288 289 289 290 SecurityContext: &corev1.SecurityContext{ ··· 371 372 } 372 373 373 374 // Build the shell script from clone commands 374 - // Add set -e for error handling and echo for visibility 375 - script := "set -e\n" + strings.Join(config.CloneCommands, "\n") + "\necho \"Repository ready\"" 375 + // Add set -e for error handling, safe.directory config to handle ownership mismatch 376 + // (emptyDir volumes are root-owned but we run as user 10000) 377 + script := "set -e\ngit config --global --add advice.detachedHead false --add safe.directory /tangled/workspace\n" + strings.Join(config.CloneCommands, "\n") + "\necho \"Repository ready\"" 376 378 377 379 return corev1.Container{ 378 380 Name: "clone-repo",