Conversation
|
Claude finished @julio4's task in 1m 15s —— View job PR Review:
|
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
Claude finished @julio4's task in 1m 38s —— View job PR Review:
|
| // applyVolumesToService maps volumes to a service | ||
| func applyVolumesToService(svc *Service, volumes map[string]*YAMLVolumeMappedConfig) { | ||
| for containerPath, volumeMapping := range volumes { | ||
| if volumeMapping.HostPath != "" { |
There was a problem hiding this comment.
No validation when a user sets conflicting fields (e.g. both host_path and name, or host_path + is_local: true). host_path silently wins. Consider validating mutual exclusivity here or documenting the precedence in the YAMLVolumeMappedConfig struct.
Also, unlike service-level HostPath which gets resolved via filepath.Abs, volume HostPath is passed through as-is. A relative path like ./data may resolve unexpectedly. Consider normalizing:
if volumeMapping.HostPath != "" {
hostPath, err := filepath.Abs(volumeMapping.HostPath)
// handle err
svc.WithHostVolume(hostPath, containerPath)
}
YAML recipes currently support named Docker volumes and session-local bind mounts, but not arbitrary host path bind mounts. This is needed for services that require access to host resources.
Concrete use case: log collections with docker socket.