internal/pkg: expose snapshot of binfmt entries
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m4s
Test / ShareFS (push) Successful in 4m4s
Test / Hakurei (race detector) (push) Successful in 6m46s
Test / Sandbox (race detector) (push) Successful in 8m30s
Test / Flake checks (push) Successful in 3m6s
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m4s
Test / ShareFS (push) Successful in 4m4s
Test / Hakurei (race detector) (push) Successful in 6m46s
Test / Sandbox (race detector) (push) Successful in 8m30s
Test / Flake checks (push) Successful in 3m6s
This is otherwise not externally accessible. The resulting map can be safely mutated. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user