Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupWorkDir(fs afero.Fs, path string)
- func CreateWorkDir(fs afero.Fs) (string, error)
- func Experimental() bool
- func FS(ctx context.Context) afero.Fs
- func HasJsonOrYamlExt(str string) bool
- func HasSuffix(str string, extensions []string) bool
- func IsFile(ctx context.Context, path string) (bool, error)
- func IsJson(data string) bool
- func IsOpaEnabled() bool
- func IsYamlMap(data string) bool
- func KeyFromKeyRef(ctx context.Context, keyRef string, fs afero.Fs) ([]byte, error)
- func PasswordFromKeyRef(ctx context.Context, keyRef string) ([]byte, error)
- func PrivateKeyFromKeyRef(ctx context.Context, keyRef string, fs afero.Fs) ([]byte, error)
- func PublicKeyFromKeyRef(ctx context.Context, keyRef string, fs afero.Fs) ([]byte, error)
- func RenderFromTemplatesWithGlob(input any, main string, glob []string, efs embed.FS) ([]byte, error)
- func RenderFromTemplatesWithMain(input any, main string, efs embed.FS) ([]byte, error)
- func SetColorEnabled(flagNoColor, flagForceColor bool)
- func SetupTemplate(efs embed.FS) (*template.Template, error)
- func SetupTemplateWithGlob(glob []string, efs embed.FS) (*template.Template, error)
- func WithFS(ctx context.Context, fs afero.Fs) context.Context
- func WriteTempFile(ctx context.Context, data, prefix string) (string, error)
Constants ¶
const K8sClientKey contextKey = "k8s.client"
Variables ¶
var ColorEnabled bool
Functions ¶
func CleanupWorkDir ¶
CleanupWorkDir removes all files in a directory Eat any errors so we can call it from defer
func CreateWorkDir ¶
CreateWorkDir creates the working directory in tmp and some subdirectories
func Experimental ¶
func Experimental() bool
detect if the EC_EXPERIMENTAL env var is set to enable experimental features
func HasJsonOrYamlExt ¶
func IsOpaEnabled ¶
func IsOpaEnabled() bool
func KeyFromKeyRef ¶ added in v0.8.36
KeyFromKeyRef resolves a key from either a file path or a Kubernetes secret reference. This provides a unified interface for both public and private key resolution. Supported formats: - File path: "/path/to/key.pem" - Kubernetes secret: "k8s://namespace/secret-name/key-field" (explicit key field) - Kubernetes secret: "k8s://namespace/secret-name" (auto-select if single key exists)
func PasswordFromKeyRef ¶ added in v0.8.77
PasswordFromKeyRef resolves a password from either environment variable or a Kubernetes secret reference. This provides a unified interface for password resolution similar to PrivateKeyFromKeyRef. Supported formats: - Environment variable: "" (empty string uses COSIGN_PASSWORD env var) - Kubernetes secret: "k8s://namespace/secret-name" (assumes "cosign.password" key) - Kubernetes secret: "k8s://namespace/secret-name/key-field" (explicit key field)
func PrivateKeyFromKeyRef ¶ added in v0.8.36
PrivateKeyFromKeyRef resolves a private key from either a file path or a Kubernetes secret reference. This follows the same pattern as cosignSig.PublicKeyFromKeyRef but for private keys. Supported formats: - File path: "/path/to/private-key.pem" - Kubernetes secret: "k8s://namespace/secret-name" - Kubernetes secret: "k8s://namespace/secret-name/key-field"
func PublicKeyFromKeyRef ¶ added in v0.8.36
PublicKeyFromKeyRef resolves a public key from either a file path or a Kubernetes secret reference. This provides a consistent interface with PrivateKeyFromKeyRef. Supported formats: - File path: "/path/to/public-key.pem" - Kubernetes secret: "k8s://namespace/secret-name/key-field" (explicit key field) - Kubernetes secret: "k8s://namespace/secret-name" (auto-select if single key exists)
func SetColorEnabled ¶
func SetColorEnabled(flagNoColor, flagForceColor bool)
func SetupTemplate ¶
Here we assume the caller will do the Execute or ExecuteTemplate themselves
func SetupTemplateWithGlob ¶
Types ¶
This section is empty.