diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-06-02 16:05:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-06-02 16:05:09 +0900 |
| commit | 9e824452bd3799050f6a36dc1774ddf7120bf78a (patch) | |
| tree | 046f2a1814b5a6faa3fd28ac3ebf6c3f35205f42 /internal | |
| parent | 56937ac396e998e6e4729612915a65e1b4e8981c (diff) | |
internal/pkg: expose snapshot of binfmt entries
This is otherwise not externally accessible. The resulting map can be safely mutated.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/pkg/exec.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go index ceb75fef..0fe20848 100644 --- a/internal/pkg/exec.go +++ b/internal/pkg/exec.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "maps" "os" "os/exec" "path/filepath" @@ -122,6 +123,15 @@ func RegisterArch(arch string, e container.BinfmtEntry) { binfmt[arch] = e } +// Arch returns a snapshot of currently registered [KindExec] and [KindExecNet] +// binfmt entries. +func Arch() map[string]container.BinfmtEntry { + binfmtMu.RLock() + r := maps.Clone(binfmt) + binfmtMu.RUnlock() + return r +} + const ( // ExecTimeoutDefault replaces out of range [NewExec] timeout values. ExecTimeoutDefault = 15 * time.Minute |
