From 438e2dfa07c4f9744cffc20414452c186d3c4a0d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Sat, 29 Mar 2025 04:45:19 +0400 Subject: [PATCH] fix: removed json functions since they're covered by Sprig lib --- k8-operator/packages/template/json.go | 32 ----------------------- k8-operator/packages/template/template.go | 4 --- 2 files changed, 36 deletions(-) delete mode 100644 k8-operator/packages/template/json.go diff --git a/k8-operator/packages/template/json.go b/k8-operator/packages/template/json.go deleted file mode 100644 index e516a609a..000000000 --- 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 e14773179..e4e24ac2a 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 (