Documentation
¶
Overview ¶
Package log implements the `kuke log` subcommand. It mirrors `kuke attach`'s flag/arg shape but instead of opening an interactive sbsh session it prints the per-container output stream. By default it dumps the current capture/log file contents and exits; pass `-f`/`--follow` to tail until SIGINT, matching `kubectl logs` / `docker logs` conventions. Bytes never traverse the daemon RPC: the daemon resolves the host path of the relevant stream and this subcommand opens that path directly.
Two paths exist depending on the target container's IO model:
- Attachable containers route output through sbsh, which writes a tty byte stream to HostCapturePath. `kuke log` reads that file.
- Non-Attachable containers (including kukeond) have the containerd runtime shim write stdout/stderr to HostLogPath via cio.LogFile. `kuke log` reads that file. Implemented per issue #203.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockControllerKey ¶
type MockControllerKey struct{}
MockControllerKey injects a kukeonv1.Client via context for tests.
type MockTailKey ¶
type MockTailKey struct{}
MockTailKey injects a tailFn via context for tests, so the real follow loop (which would block on a real file) can be bypassed.
type TailFn ¶ added in v0.4.0
type TailFn = tailFn
TailFn is the exported alias for tailFile-shaped functions: open path, dump current contents to out, and optionally follow until ctx is cancelled. Sibling commands that share `kuke log`'s streaming semantics (e.g. `kuke daemon logs`) accept values of this type for injection.