Skip to content

Commit eb50243

Browse files
committed
fix escaping
1 parent be37f54 commit eb50243

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

internal/orchestrator/orchestrator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,15 +1068,15 @@ func getDevices() (*deviceResult, error) {
10681068
}
10691069
// Verify if there are real video devices (cameras) in /dev/v4l/by-id
10701070
if camDevices := getVideoDevices(); len(camDevices) > 0 {
1071-
res.deviceCgroupRules = append(res.deviceCgroupRules, "c 81:* rwm") // rule for V4L devices
1071+
res.deviceCgroupRules = append(res.deviceCgroupRules, "\"c 81:* rwm\"") // rule for V4L devices
10721072
if paths.New("/dev/v4l").Exist() {
10731073
res.additionalDeviceVolumes = append(res.additionalDeviceVolumes, "/dev/v4l")
10741074
}
10751075
res.hasVideoDevice = true
10761076
}
10771077
// Verify if there are real sound devices in /dev/snd/by-id
10781078
if sndDev := getSoundDevices(); len(sndDev) > 0 {
1079-
res.deviceCgroupRules = append(res.deviceCgroupRules, "c 116:* rwm") // rule for ALSA devices
1079+
res.deviceCgroupRules = append(res.deviceCgroupRules, "\"c 116:* rwm\"") // rule for ALSA devices
10801080
if paths.New("/dev/snd").Exist() {
10811081
res.additionalDeviceVolumes = append(res.additionalDeviceVolumes, "/dev/snd")
10821082
}

internal/orchestrator/provision.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -358,19 +358,16 @@ func generateMainComposeFile(
358358

359359
mainAppCompose.Services = &mainService{
360360
Main: service{
361-
Image: pythonImage,
362-
Volumes: volumes,
363-
Ports: slices.Collect(maps.Keys(ports)),
364-
Devices: devices.devicePaths,
365-
DeviceCgroupRules: []string{
366-
"c 81:* rwm", // rule for V4L
367-
"c 116:* rwm", // rule for ALSA devices
368-
},
369-
Entrypoint: "/run.sh",
370-
DependsOn: dependsOn,
371-
User: getCurrentUser(),
372-
GroupAdd: append(groups, "gpiod"),
373-
ExtraHosts: []string{"msgpack-rpc-router:host-gateway"},
361+
Image: pythonImage,
362+
Volumes: volumes,
363+
Ports: slices.Collect(maps.Keys(ports)),
364+
Devices: devices.devicePaths,
365+
DeviceCgroupRules: devices.deviceCgroupRules,
366+
Entrypoint: "/run.sh",
367+
DependsOn: dependsOn,
368+
User: getCurrentUser(),
369+
GroupAdd: append(groups, "gpiod"),
370+
ExtraHosts: []string{"msgpack-rpc-router:host-gateway"},
374371
Labels: map[string]string{
375372
DockerAppLabel: "true",
376373
DockerAppMainLabel: "true",

0 commit comments

Comments
 (0)