avpcompat

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package avpcompat mirrors where argocd-vault-plugin (AVP) substitutes placeholders, without any secret backend: every placeholder AVP would resolve becomes a deterministic marker derived from the placeholder's identity. Parity means drydock substitutes exactly where AVP substitutes and nowhere else, so the matching, span selection and traversal rules below are copied from AVP v1.18.1 pkg/kube/util.go and pkg/kube/template.go and cite the lines they mirror.

Index

Constants

View Source
const IgnoreAnnotation = "avp.kubernetes.io/ignore"

IgnoreAnnotation marks an object AVP emits verbatim: cmd/generate.go:93-102 skips Replace() when its value parses true with strconv.ParseBool.

View Source
const PathAnnotation = "avp.kubernetes.io/path"

PathAnnotation is the AVP annotation that scopes generic <key> placeholders to a backend path.

Variables

This section is empty.

Functions

func ContainsPlaceholder

func ContainsPlaceholder(value string) bool

ContainsPlaceholder reports whether value contains an inline path placeholder that AVP would substitute without a path annotation.

func ReplaceString

func ReplaceString(value string) (string, bool)

ReplaceString replaces inline path placeholders with stable redacted values, as AVP does for a manifest without the path annotation.

func ReplaceStringWithOptions added in v0.3.4

func ReplaceStringWithOptions(value string, opts Options) (string, bool)

ReplaceStringWithOptions replaces placeholders in a single string under the given manifest context.

func ReplaceStringWithPath added in v0.1.19

func ReplaceStringWithPath(value string, defaultPath string) (string, bool)

ReplaceStringWithPath replaces placeholders as AVP does for a manifest whose path annotation is present with the given value: inline path placeholders and, when defaultPath is non-empty, generic <key> placeholders.

func ReplaceValue

func ReplaceValue(value any) (any, bool)

ReplaceValue replaces inline path placeholders through decoded YAML/JSON values, as AVP does for a manifest without the path annotation.

func ReplaceValueWithOptions added in v0.3.4

func ReplaceValueWithOptions(value any, opts Options) (any, bool)

ReplaceValueWithOptions replaces placeholders through decoded YAML/JSON values under the given manifest context. The input is never mutated; the returned value shares unchanged subtrees with it.

func ReplaceValueWithPath added in v0.1.19

func ReplaceValueWithPath(value any, defaultPath string) (any, bool)

ReplaceValueWithPath replaces placeholders through decoded YAML/JSON values as AVP does for a manifest whose path annotation is present with the given value.

Types

type Options added in v0.3.4

type Options struct {
	// Kind is the manifest's top-level kind. AVP picks one replacer per object
	// from this string alone (template.go:70-77): "Secret" selects the
	// base64-aware replacer, everything else is processed as plain text.
	Kind string
	// PathAnnotationPresent reports whether metadata.annotations carries the
	// avp.kubernetes.io/path key at all. AVP selects the placeholder regex on
	// key presence, not on the value (util.go:113-115), so an empty annotation
	// still switches to the generic regex.
	PathAnnotationPresent bool
	// Path is the annotation value. Generic placeholders are only resolvable
	// when it is non-empty (template.go:33-48: an empty path fetches nothing,
	// so every generic lookup misses and AVP leaves the match unchanged).
	Path string
}

Options describes the manifest context AVP derives its replacement rules from (pkg/kube/template.go:31-60, 67-79).

Jump to

Keyboard shortcuts

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