From 81e055d9c664b24e4c92786d6d6bf58a60b192fd Mon Sep 17 00:00:00 2001 From: Shang Ma Date: Tue, 7 Sep 2021 12:47:18 -0700 Subject: [PATCH] clear data section for secret --- pkg/manager/client/discovery.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/manager/client/discovery.go b/pkg/manager/client/discovery.go index c00ecd899..550740020 100644 --- a/pkg/manager/client/discovery.go +++ b/pkg/manager/client/discovery.go @@ -78,6 +78,17 @@ func toObj(b []byte, groupVersion, kind string) (interface{}, error) { } } + if kind == "Secret" { + for _, child := range jsonParsed.S("items").Children() { + if exists := child.Exists("data"); exists { + _, err := child.SetP("", "data") + if err != nil { + logrus.Error("Unable to clear data section") + } + } + } + } + return jsonParsed.Data(), nil }