Skip to content

Commit

Permalink
Fix gosec issue
Browse files Browse the repository at this point in the history
  • Loading branch information
satyakonduri committed Nov 14, 2024
1 parent 2c3928b commit 1d9fb4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/shared/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ package shared

import (
"os"

"log"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"

"path/filepath"
csmv1 "github.com/dell/csm-operator/api/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -172,7 +172,10 @@ func MakeConfigMap(name, ns, _ string) *corev1.ConfigMap {

// MakeSecretWithJSON returns a driver pre-req secret array-config
func MakeSecretWithJSON(name string, ns string, configFile string) *corev1.Secret {
configJSON, _ := os.ReadFile(configFile)
configJSON, err := os.ReadFile(filepath.Clean(configFile))
if err != nil {
log.Fatalf("failed to read testdata: %v", err)
}
data := map[string][]byte{
"config": configJSON,
}
Expand Down

0 comments on commit 1d9fb4a

Please sign in to comment.