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
- func ContainsPlaceholder(value string) bool
- func ReplaceString(value string) (string, bool)
- func ReplaceStringWithOptions(value string, opts Options) (string, bool)
- func ReplaceStringWithPath(value string, defaultPath string) (string, bool)
- func ReplaceValue(value any) (any, bool)
- func ReplaceValueWithOptions(value any, opts Options) (any, bool)
- func ReplaceValueWithPath(value any, defaultPath string) (any, bool)
- type Options
Constants ¶
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.
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 ¶
ContainsPlaceholder reports whether value contains an inline path placeholder that AVP would substitute without a path annotation.
func ReplaceString ¶
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
ReplaceStringWithOptions replaces placeholders in a single string under the given manifest context.
func ReplaceStringWithPath ¶ added in v0.1.19
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 ¶
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
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.
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).