policy: image signature verification support

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2026-01-14 09:03:42 -08:00
parent b2697ae933
commit 87d4189039
913 changed files with 164234 additions and 13050 deletions
+30
View File
@@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
package debug
import (
"fmt"
"log"
"os"
"path/filepath"
"runtime"
)
var (
output = os.Stdout
)
// GetLogger provides a prefix debug logger
func GetLogger(prefix string, debug bool) func(string, ...any) {
if debug {
logger := log.New(output, prefix+":", log.LstdFlags)
return func(msg string, args ...any) {
_, file1, pos1, _ := runtime.Caller(1)
logger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...))
}
}
return func(_ string, _ ...any) {}
}