utils

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DebugModeEnvKey string = "DEBUG"
)

Variables

This section is empty.

Functions

func CaptureWorkloadImage

func CaptureWorkloadImage(logger *log.ZapLogger, imageVersion string, debug bool, vs VersionSource) string

TODO: currently, we return only the default capture workload image for official release in the phase of preview, and using the same version for CLI and capture workload image makes sure there's no compatibility issue. We can consider exposing the image name and version through CLI flags and adding version compatibility validation for CLI and capture workload image.

func GetContainerLabelsFromCaptureName

func GetContainerLabelsFromCaptureName(captureName string) map[string]string

func GetDownloadLabelsFromCaptureName added in v1.0.0

func GetDownloadLabelsFromCaptureName(captureName string) map[string]string

func GetJobLabelsFromCaptureName

func GetJobLabelsFromCaptureName(captureName string) map[string]string

func GetPodAnnotationsFromCapture added in v0.0.35

func GetPodAnnotationsFromCapture(capture *retinav1alpha1.Capture, resolvedHostPath string) map[string]string

GetPodAnnotationsFromCapture builds the capture pod annotations. resolvedHostPath, when non-empty, is written as the CaptureHostPathAnnotationKey value (the on-node path actually mounted into the capture pod). When empty, the raw value from the Capture spec is used as a fallback (e.g. when called from contexts where the host path has not been resolved yet).

func GetSerectLabelsFromCaptureName

func GetSerectLabelsFromCaptureName(captureName string) map[string]string

func RedactURLQueries added in v1.3.3

func RedactURLQueries(s string) string

RedactURLQueries replaces the query string of every URL in s, any SAS signature (sig=...), and any query value echoed in a storage service error (QueryParameterValue), with REDACTED. Scheme, host and path are kept so messages still say where a request went.

func RedactURLQueriesInError added in v1.3.3

func RedactURLQueriesInError(err error) error

RedactURLQueriesInError returns err with RedactURLQueries applied to its message, so it can be logged or returned without exposing credentials carried in URLs. errors.Is still matches against the original error chain, but errors.As and errors.Unwrap don't reach it, so the original (which contains the credential) can't be printed by mistake.

Types

type VersionSource

type VersionSource string
const (
	// VersionSourceCLI defines the version source as CLI version.
	VersionSourceCLIVersion VersionSource = "CLI version"
	// VersionSourceImage defines the version source as image version.
	VersionSourceOperatorImageVersion VersionSource = "Operator Image"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL