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