Skip to content

Commit e2adfa3

Browse files
authored
fix: Correct selector used to find installer specs when redacting (#1456)
1 parent 41134ca commit e2adfa3

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ E2EPATHS = ./test/e2e/...
4040
TESTFLAGS ?= -v -coverprofile cover.out
4141

4242
.DEFAULT_GOAL := all
43-
all: build test
43+
all: clean build test
4444

4545
.PHONY: ffi
4646
ffi: fmt vet

pkg/redact/redact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func getRedactors(path string) ([]Redactor, error) {
456456

457457
uniqueCRs := map[string]bool{}
458458
for _, cr := range customResources {
459-
fileglob := fmt.Sprintf("%s/%s/%s/*", constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_CUSTOM_RESOURCES, cr.resource)
459+
fileglob := fmt.Sprintf("%s/%s/%s/*.yaml", constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_CUSTOM_RESOURCES, cr.resource)
460460
redactors = append(redactors, NewYamlRedactor(cr.yamlPath, fileglob, ""))
461461

462462
// redact kubectl last applied annotation once for each resource since it contains copies of

pkg/redact/yaml.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bufio"
55
"bytes"
66
"io"
7-
"io/ioutil"
87
"path/filepath"
98
"strconv"
109
"strings"
@@ -50,7 +49,7 @@ func (r *YamlRedactor) Redact(input io.Reader, path string) io.Reader {
5049
reader := bufio.NewReader(input)
5150

5251
var doc []byte
53-
doc, err = ioutil.ReadAll(reader)
52+
doc, err = io.ReadAll(reader)
5453
var yamlInterface interface{}
5554
err = yaml.Unmarshal(doc, &yamlInterface)
5655
if err != nil {
@@ -84,8 +83,6 @@ func (r *YamlRedactor) Redact(input io.Reader, path string) io.Reader {
8483
File: path,
8584
IsDefaultRedactor: r.isDefault,
8685
})
87-
88-
return
8986
}()
9087
return reader
9188
}

0 commit comments

Comments
 (0)