File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -176,15 +176,7 @@ func redactList(list *unstructured.UnstructuredList) error {
176176 for _ , gvk := range gvks {
177177 // If this item is a Secret then we need to redact it.
178178 if gvk .Kind == "Secret" && (gvk .Group == "core" || gvk .Group == "" ) {
179- Select ([]string {
180- "kind" ,
181- "apiVersion" ,
182- "metadata.name" ,
183- "metadata.namespace" ,
184- "type" ,
185- "/data/tls.crt" ,
186- "/data/ca.crt" ,
187- }, & resource )
179+ Select (SecretSelectedFields , & resource )
188180
189181 // break when the object has been processed as a secret, no
190182 // other kinds have redact modifications
Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ import (
99 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1010)
1111
12+ // SecretSelectedFields is the list of fields sent from Secret objects to the
13+ // backend
14+ var SecretSelectedFields = []string {
15+ "kind" ,
16+ "apiVersion" ,
17+ "metadata.name" ,
18+ "metadata.namespace" ,
19+ "type" ,
20+ "/data/tls.crt" ,
21+ "/data/ca.crt" ,
22+ }
23+
1224// Select removes all but the supplied fields from the resource
1325func Select (fields []string , resource * unstructured.Unstructured ) error {
1426 // convert the object to JSON for field filtering
You can’t perform that action at this time.
0 commit comments