Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: removed json functions since they're covered by Sprig lib

Daniel Hougaard438e2dfa07c4
diff --git a/k8-operator/packages/template/json.go b/k8-operator/packages/template/json.go
deleted file mode 100644
index e516a609a7..0000000000
--- a/k8-operator/packages/template/json.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package template
-
-import (
- "encoding/json"
- "fmt"
-)
-
-func fromJSON(in []byte) any {
- var out any
- err := json.Unmarshal(in, &out)
- if err != nil {
- panic(fmt.Sprintf(errUnmarshalJSON, err))
- }
- return out
-}
-
-func toJSON(in any) string {
- output, err := json.Marshal(in)
- if err != nil {
- panic(fmt.Sprintf(errMarshalJSON, err))
- }
- return string(output)
-}
-
-func jsonStringToJSON(in string) any {
- var out any
- err := json.Unmarshal([]byte(in), &out)
- if err != nil {
- panic(fmt.Sprintf(errUnmarshalJSON, err))
- }
- return out
-}
diff --git a/k8-operator/packages/template/template.go b/k8-operator/packages/template/template.go
index e147731790..e4e24ac2a9 100644
--- a/k8-operator/packages/template/template.go
+++ b/k8-operator/packages/template/template.go
@@ -30,10 +30,6 @@ var customInfisicalSecretTemplateFunctions = tpl.FuncMap{
"decodeBase64ToBytes": decodeBase64ToBytes,
"encodeBase64": encodeBase64,
-
- "fromJson": fromJSON,
- "fromJsonStringToJson": jsonStringToJSON,
- "toJson": toJSON,
}
const (