[PR #10] [MERGED] Improve Portainer logs and attach behavior #12

Closed
opened 2026-10-15 12:51:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/10
Author: @JBailes
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @JBailes

Base: docker-lxc-daemon ← Head: aimee/session/portainer-logs-attach


📝 Commits (10+)

  • f6dadc7 Honor Portainer log tail requests
  • 92aa3a7 Relax Portainer attach streaming requirements
  • 8918cca Stream Portainer push failures
  • c273b3c Improve Portainer image search
  • 129c793 Harden Portainer image pull flows
  • 31d7b14 Tighten Portainer log replay handling
  • 52bea78 Refine Portainer image search results
  • 66da5f5 Support richer Portainer log queries
  • 98dbc04 Fix Portainer archive HEAD responses
  • 796d0a5 Make Portainer attach fallback usable

📊 Changes

14 files changed (+3280 additions, -274 deletions)

View changed files

📝 internal/api/build.go (+313 -19)
📝 internal/api/containers.go (+837 -60)
📝 internal/api/containers_extra.go (+172 -7)
📝 internal/api/exec.go (+92 -5)
📝 internal/api/images.go (+434 -38)
➕ internal/api/list_filters.go (+210 -0)
➕ internal/api/portainer_ops.go (+411 -0)
📝 internal/api/router.go (+44 -8)
📝 internal/api/system.go (+267 -33)
📝 internal/api/types.go (+276 -65)
📝 internal/api/volumes.go (+32 -1)
📝 internal/lxc/manager.go (+30 -9)
📝 internal/oci/pull.go (+49 -11)
📝 internal/store/store.go (+113 -18)

📄 Description

Summary

  • honor logs?tail= so Portainer log views can request just the most recent lines instead of replaying the full console log every time
  • relax attach streaming requirements by falling back to a non-hijack raw stream when http.Hijacker is unavailable

Why

PR #9 landed the core exec-streaming fix, but two small Portainer-facing follow-ups were still sitting on that merged branch. This PR isolates the remaining log-tail and attach-streaming hardening on top of the latest docker-lxc-daemon.

Validation

  • GOCACHE=/tmp/go-build-cache go test ./...
  • validated logs?tail=2 and logs?tail=5 on root@192.168.1.253 against the running Portainer container through a transient daemon socket, with materially different framed response sizes

Notes

  • attach follows the same fallback pattern already validated for /exec
  • I did not do a full interactive terminal validation of attach itself on the host

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/LXC2Docker/pull/10 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `docker-lxc-daemon` ← **Head:** `aimee/session/portainer-logs-attach` --- ### 📝 Commits (10+) - [`f6dadc7`](https://github.com/games-on-whales/LXC2Docker/commit/f6dadc72e87d1966a0a282feb2539274a38b977d) Honor Portainer log tail requests - [`92aa3a7`](https://github.com/games-on-whales/LXC2Docker/commit/92aa3a7ae8f6615a021b0f2dbea6d151855d8b1f) Relax Portainer attach streaming requirements - [`8918cca`](https://github.com/games-on-whales/LXC2Docker/commit/8918ccaecad30a272cf6e3179a92bb9b873639c6) Stream Portainer push failures - [`c273b3c`](https://github.com/games-on-whales/LXC2Docker/commit/c273b3c7052fc3401b0d9322d85aba10c1bb5726) Improve Portainer image search - [`129c793`](https://github.com/games-on-whales/LXC2Docker/commit/129c7937db6b5e959420580ef636e6d2121eb8d8) Harden Portainer image pull flows - [`31d7b14`](https://github.com/games-on-whales/LXC2Docker/commit/31d7b14c35d5a14f6dc6736adf4637e0c1a104eb) Tighten Portainer log replay handling - [`52bea78`](https://github.com/games-on-whales/LXC2Docker/commit/52bea78bb0ffaa234f1162b13e2c66fb9fb1c946) Refine Portainer image search results - [`66da5f5`](https://github.com/games-on-whales/LXC2Docker/commit/66da5f530dd2db3bdf2d4f7e6a955e0b93d5da1a) Support richer Portainer log queries - [`98dbc04`](https://github.com/games-on-whales/LXC2Docker/commit/98dbc04820e2d393e7d1c6d0b7aeb3b922c72ed1) Fix Portainer archive HEAD responses - [`796d0a5`](https://github.com/games-on-whales/LXC2Docker/commit/796d0a5035e6bd05392dfec7cf98189c02e51d5b) Make Portainer attach fallback usable ### 📊 Changes **14 files changed** (+3280 additions, -274 deletions) <details> <summary>View changed files</summary> 📝 `internal/api/build.go` (+313 -19) 📝 `internal/api/containers.go` (+837 -60) 📝 `internal/api/containers_extra.go` (+172 -7) 📝 `internal/api/exec.go` (+92 -5) 📝 `internal/api/images.go` (+434 -38) ➕ `internal/api/list_filters.go` (+210 -0) ➕ `internal/api/portainer_ops.go` (+411 -0) 📝 `internal/api/router.go` (+44 -8) 📝 `internal/api/system.go` (+267 -33) 📝 `internal/api/types.go` (+276 -65) 📝 `internal/api/volumes.go` (+32 -1) 📝 `internal/lxc/manager.go` (+30 -9) 📝 `internal/oci/pull.go` (+49 -11) 📝 `internal/store/store.go` (+113 -18) </details> ### 📄 Description ## Summary - honor `logs?tail=` so Portainer log views can request just the most recent lines instead of replaying the full console log every time - relax `attach` streaming requirements by falling back to a non-hijack raw stream when `http.Hijacker` is unavailable ## Why PR #9 landed the core exec-streaming fix, but two small Portainer-facing follow-ups were still sitting on that merged branch. This PR isolates the remaining log-tail and attach-streaming hardening on top of the latest `docker-lxc-daemon`. ## Validation - `GOCACHE=/tmp/go-build-cache go test ./...` - validated `logs?tail=2` and `logs?tail=5` on `root@192.168.1.253` against the running Portainer container through a transient daemon socket, with materially different framed response sizes ## Notes - `attach` follows the same fallback pattern already validated for `/exec` - I did not do a full interactive terminal validation of `attach` itself on the host --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:51:15 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/LXC2Docker#12
No description provided.