Skip to content

Commit

Permalink
enable templating keys with vault secrets
Browse files Browse the repository at this point in the history
Signed-off-by: Omri Shiv <327609+OmriShiv@users.noreply.github.com>
  • Loading branch information
omrishiv committed May 14, 2023
1 parent 717f1c0 commit 931eeb0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/kube/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func replaceInner(

obj := *node
for key, value := range obj {
keyReplacement := false
if genericPlaceholder.FindString(key) != "" {
keyReplacement = true
replacement, _ := replacerFunc(key, key, *r)
obj[replacement.(string)] = value
delete(obj, key)
}

valueType := reflect.ValueOf(value).Kind()

// Recurse through nested maps
Expand Down Expand Up @@ -95,7 +103,7 @@ func replaceInner(
if removeKey {
utils.VerboseToStdErr("removing key %s due to %s being set on the containing manifest", key, types.AVPRemoveMissingAnnotation)
delete(obj, key)
} else {
} else if keyReplacement == false {
obj[key] = replacement
}
}
Expand Down

0 comments on commit 931eeb0

Please sign in to comment.