fix: Correct selector used to find installer specs when redacting (#1456)

This commit is contained in:
Evans Mungai
2024-02-07 10:36:15 +00:00
committed by GitHub
parent 41134ca621
commit e2adfa3774
3 changed files with 3 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ E2EPATHS = ./test/e2e/...
TESTFLAGS ?= -v -coverprofile cover.out
.DEFAULT_GOAL := all
all: build test
all: clean build test
.PHONY: ffi
ffi: fmt vet

View File

@@ -456,7 +456,7 @@ func getRedactors(path string) ([]Redactor, error) {
uniqueCRs := map[string]bool{}
for _, cr := range customResources {
fileglob := fmt.Sprintf("%s/%s/%s/*", constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_CUSTOM_RESOURCES, cr.resource)
fileglob := fmt.Sprintf("%s/%s/%s/*.yaml", constants.CLUSTER_RESOURCES_DIR, constants.CLUSTER_RESOURCES_CUSTOM_RESOURCES, cr.resource)
redactors = append(redactors, NewYamlRedactor(cr.yamlPath, fileglob, ""))
// redact kubectl last applied annotation once for each resource since it contains copies of

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"bytes"
"io"
"io/ioutil"
"path/filepath"
"strconv"
"strings"
@@ -50,7 +49,7 @@ func (r *YamlRedactor) Redact(input io.Reader, path string) io.Reader {
reader := bufio.NewReader(input)
var doc []byte
doc, err = ioutil.ReadAll(reader)
doc, err = io.ReadAll(reader)
var yamlInterface interface{}
err = yaml.Unmarshal(doc, &yamlInterface)
if err != nil {
@@ -84,8 +83,6 @@ func (r *YamlRedactor) Redact(input io.Reader, path string) io.Reader {
File: path,
IsDefaultRedactor: r.isDefault,
})
return
}()
return reader
}