mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-11-26 06:55:25 +00:00
feat(k8s): pushsecret go templating
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var InfisicalSecretTemplateFunctions = template.FuncMap{
|
||||
"decodeBase64ToBytes": func(encodedString string) string {
|
||||
decoded, err := base64.StdEncoding.DecodeString(encodedString)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Error: %v", err))
|
||||
}
|
||||
return string(decoded)
|
||||
},
|
||||
"encodeBase64": func(plainString string) string {
|
||||
return base64.StdEncoding.EncodeToString([]byte(plainString))
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user