Skip invalid Docker resources instead of failing entire blueprint (#1784) #142

Open
opened 2026-04-05 17:01:27 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @LunarECL on 3/8/2026

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Fixes #1784

If one Docker container had bad labels (like missing a port on a container with no EXPOSE), it would block every other container from updating too. Not great.

Now there's a per-resource pre-validation step in applyNewtDockerBlueprint.ts that catches invalid resources and filters them out before they hit applyBlueprint(). Valid ones still go through the normal ConfigSchema validation, so cross-resource checks like domain/port/alias uniqueness work the same as before. Invalid ones just get logged with the Zod error path and skipped.

Only touched server/lib/blueprints/applyNewtDockerBlueprint.ts. Everything else (applyBlueprint.ts, types.ts, parseDockerContainers.ts) is unchanged.

How to test?

  1. Set up two Docker services with Pangolin labels on the same Docker socket
  2. Remove the port label from one service that has no EXPOSE directive
  3. Update a label on the other (valid) service
  4. Before fix: Both services fail to update. Log shows Validation error: Required at "proxy-resources.testservice.targets[0].port"
  5. After fix: Valid service updates normally. Invalid service gets skipped with a warning: Skipping invalid Docker proxy-resources "testservice": targets.0.port: RequiredRequired`
*Originally created by @LunarECL on 3/8/2026* ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Fixes #1784 If one Docker container had bad labels (like missing a port on a container with no EXPOSE), it would block every other container from updating too. Not great. Now there's a per-resource pre-validation step in `applyNewtDockerBlueprint.ts` that catches invalid resources and filters them out before they hit `applyBlueprint()`. Valid ones still go through the normal `ConfigSchema` validation, so cross-resource checks like domain/port/alias uniqueness work the same as before. Invalid ones just get logged with the Zod error path and skipped. Only touched `server/lib/blueprints/applyNewtDockerBlueprint.ts`. Everything else (`applyBlueprint.ts`, `types.ts`, `parseDockerContainers.ts`) is unchanged. ## How to test? 1. Set up two Docker services with Pangolin labels on the same Docker socket 2. Remove the `port` label from one service that has no `EXPOSE` directive 3. Update a label on the other (valid) service 4. **Before fix:** Both services fail to update. Log shows `Validation error: Required at "proxy-resources.testservice.targets[0].port"` 5. **After fix:** Valid service updates normally. Invalid service gets skipped with a warning: `Skipping invalid Docker proxy-resources "testservice": targets.0.port: Required`Required`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#142