Conversation
|
Claude finished @canercidam's task in 1m 49s —— View job Review of PR #404: Generate k8s manifests for recipes
SummaryThis PR adds k8s manifest generation by shelling out to Bugs:
Design issues:
Suggestion:
|
| cmd := exec.Command("kompose", "convert", | ||
| "-f", composeFile, | ||
| "--volumes", "hostPath", | ||
| "-o", k8sDir, | ||
| ) | ||
| var outBuf, errBuf bytes.Buffer | ||
| cmd.Stdout = &outBuf | ||
| cmd.Stderr = &errBuf | ||
| if err := cmd.Run(); err != nil { | ||
| return fmt.Errorf("kompose convert failed: %w\n%s", err, errBuf.String()) | ||
| } |
There was a problem hiding this comment.
Missing kompose availability check. If kompose isn't installed, the error message from cmd.Run() won't be very helpful (exec: "kompose": executable file not found in $PATH buried in the error chain). Consider checking exec.LookPath("kompose") first and returning a user-friendly message like "kompose is required but not found in PATH; install it from https://kompose.io/".
There was a problem hiding this comment.
Good to have, will deal with this before merge.
builder-playground dirwhich can be used likecd $(builder-playground dir)/k8sto navigate to the k8s files of the latest run--k8sflag forstart. Usage:go install .or dogo build .and use local binarykomposeCLIbuilder-playground start l1 --dry-run --k8scd $(builder-playground dir)/k8s./minikube-mount.shminikube startif you haven't started yet and dokubectl apply -f .minikube dashboardkubectl port-forward service/el 8545:8545builder-playground testto verify that the deployed stack can build a new block with a new txI tested this with the
opstackrecipe. It doesn't work yet but we're close.The outputted files are useful for kickstarting a k8s setup and iterating from there. Playground doesn't deploy to k8s yet.