mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
fix: Correct selector used to find installer specs when redacting (#1456)
This commit is contained in:
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user