feat(app,docker): add extension points for port-forward (BE)#355
Merged
Conversation
- TaskEntry.ContainerID populated from task.Status.ContainerStatus.ContainerID (nil-guarded). Needed by the BE port-forward replica picker so the agent can dial the correct container without a second TaskInspectWithRaw. - app.RegisterShutdownHook / RunShutdownHooks for app-level cleanup hooks invoked synchronously after tea.Program.Run returns. The BE port-forward manager will register CloseAll here so listeners drain on tea.Quit. Both purely additive; no existing callsite changed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Reflects the additive exports added in the same PR. Documentation-only. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two purely additive changes to the OSS that the upcoming Pro port-forward feature (issue Eldara-Tech/swarmcli-be#13) needs as extension points. Mirrors the established pattern by which the OSS exposes generic hooks (no Pro-specific logic) for the BE to plug into.
docker.TaskEntry.ContainerID— populated fromtask.Status.ContainerStatus.ContainerIDwith a nil-guard, in bothGetTasksForStackandGetTasksForService. The BE port-forward replica picker needs the container ID to send to the agent without a secondTaskInspectWithRawround-trip.app.RegisterShutdownHook(fn func())/app.RunShutdownHooks()— package-level cleanup hooks.swarmcli-be/main.gowill registerportforwards.Default().CloseAllhere so local TCP listeners and WebSocket connections drain synchronously aftertea.Program.Runreturns.Phase 1 of 14 in the port-forward implementation plan. No callsite in this repo reads either; the changes are ready for use by Pro once a CE release tag lands.
Test plan
go build ./...cleango test ./docker/ ./app/ ./views/services/passesgolangci-lint run ./docker/... ./app/...cleanswarmcli-becan bump.swarmcli-ref🤖 Generated with Claude Code