Skip to content

Commit 6949002

Browse files
dhaiducekopenshift-ci[bot]
authored andcommitted
nosec gosec
Signed-off-by: Dale Haiducek <[email protected]>
1 parent 3b63f87 commit 6949002

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

cmd/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func processGeneratorConfig(filePath string) []byte {
6161

6262
p := internal.Plugin{}
6363

64+
// #nosec G304
6465
fileData, err := ioutil.ReadFile(filePath)
6566
if err != nil {
6667
errorAndExit("failed to read file '%s': %s", filePath, err)

internal/patches.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func (m *manifestPatcher) Validate() error {
8989
namespace, _, _ := unstructured.NestedString(manifest, "metadata", "namespace")
9090

9191
// Apply defaults on the patches
92-
for _, patch := range m.patches {
93-
err := setPatchDefaults(apiVersion, kind, name, namespace, &patch)
92+
for i := range m.patches {
93+
err := setPatchDefaults(apiVersion, kind, name, namespace, &m.patches[i])
9494
if err != nil {
9595
return err
9696
}

internal/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ func handleExpanders(
318318
// If the file cannot be decoded or each document is not a map, an error will
319319
// be returned.
320320
func unmarshalManifestFile(manifestPath string) (*[]map[string]interface{}, error) {
321+
// #nosec G304
321322
manifestBytes, err := ioutil.ReadFile(manifestPath)
322323
if err != nil {
323324
return nil, fmt.Errorf("failed to read the manifest file %s", manifestPath)

0 commit comments

Comments
 (0)