Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bug: fix required_devices handling #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Xayton merged 1 commit into arduino:main from rjtokenring:fix-list-required-devices
Dec 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions internal/orchestrator/provision.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -236,39 +236,39 @@ func generateMainComposeFile(
ports[fmt.Sprintf("%s:%s", p, p)] = struct{}{}
}

// 2. Collect all the required device classes
if len(idxBrick.RequiredDevices) > 0 {
for _, deviceClass := range idxBrick.RequiredDevices {
requiredDeviceClasses[deviceClass] = true
}
}

// The following code is needed only if the brick requires a container.
// In case it doesn't we just skip to the next one.
if !idxBrick.RequireContainer {
Copy link
Contributor Author

@rjtokenring rjtokenring Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required devices was loading after checking if bricks requires a container.
So, required devices are not loaded in case of bricks without a container

continue
}

// 2. Retrieve the brick_compose.yaml file.
// 3. Retrieve the brick_compose.yaml file.
composeFilePath, err := staticStore.GetBrickComposeFilePathFromID(brick.ID)
if err != nil {
slog.Error("brick compose id not valid", slog.String("error", err.Error()), slog.String("brick_id", brick.ID))
continue
}

// 3. Retrieve the compose services names.
// 4. Retrieve the compose services names.
svcs, err := extractServicesFromComposeFile(composeFilePath)
if err != nil {
slog.Error("loading brick_compose", slog.String("brick_id", brick.ID), slog.String("path", composeFilePath.String()), slog.Any("error", err))
continue
}

// 4. Retrieve the required devices that we have to mount
// 5. Retrieve the required devices that we have to mount
slog.Debug("Brick config", slog.Bool("mount_devices_into_container", idxBrick.MountDevicesIntoContainer), slog.Any("ports", ports), slog.Any("required_devices", idxBrick.RequiredDevices))
if idxBrick.MountDevicesIntoContainer {
servicesThatRequireDevices = slices.AppendSeq(servicesThatRequireDevices, maps.Keys(svcs))
}

// 5. Collect all the required device classes
if len(idxBrick.RequiredDevices) > 0 {
for _, deviceClass := range idxBrick.RequiredDevices {
requiredDeviceClasses[deviceClass] = true
}
}

composeFiles.Add(composeFilePath)
maps.Insert(services, maps.All(svcs))
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /