mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Fix gometalinter issues
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
@ -39,15 +39,13 @@ const cephKeyring = `[client.{{.UserID}}]
|
||||
key = {{.Key}}
|
||||
`
|
||||
|
||||
// gosec
|
||||
const cephSecret = `{{.Key}}`
|
||||
const cephSecret = `{{.Key}}` // #nosec
|
||||
|
||||
// gosec
|
||||
const (
|
||||
cephConfigRoot = "/etc/ceph"
|
||||
cephConfigFileNameFmt = "ceph.share.%s.conf"
|
||||
cephKeyringFileNameFmt = "ceph.share.%s.client.%s.keyring"
|
||||
cephSecretFileNameFmt = "ceph.share.%s.client.%s.secret"
|
||||
cephSecretFileNameFmt = "ceph.share.%s.client.%s.secret" // #nosec
|
||||
)
|
||||
|
||||
var (
|
||||
@ -78,7 +76,7 @@ type cephConfigData struct {
|
||||
}
|
||||
|
||||
func writeCephTemplate(fileName string, m os.FileMode, t *template.Template, data interface{}) error {
|
||||
// gosec
|
||||
// #nosec
|
||||
if err := os.MkdirAll(cephConfigRoot, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ func makeVolumeID(volName string) volumeID {
|
||||
func execCommand(command string, args ...string) ([]byte, error) {
|
||||
glog.V(4).Infof("cephfs: EXEC %s %s", command, args)
|
||||
|
||||
cmd := exec.Command(command, args...)
|
||||
cmd := exec.Command(command, args...) // #nosec
|
||||
return cmd.CombinedOutput()
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,9 @@ var (
|
||||
// Load available ceph mounters installed on system into availableMounters
|
||||
// Called from driver.go's Run()
|
||||
func loadAvailableMounters() error {
|
||||
// #nosec
|
||||
fuseMounterProbe := exec.Command("ceph-fuse", "--version")
|
||||
// #nosec
|
||||
kernelMounterProbe := exec.Command("mount.ceph")
|
||||
|
||||
if fuseMounterProbe.Run() == nil {
|
||||
|
@ -132,8 +132,8 @@ func newVolumeOptions(volOptions, secret map[string]string) (*volumeOptions, err
|
||||
}
|
||||
|
||||
// This field is optional, don't check for its presence
|
||||
// nolint: errcheck
|
||||
// (skip errcheck as this is optional)
|
||||
// nolint
|
||||
// (skip errcheck and gosec as this is optional)
|
||||
extractOption(&opts.Mounter, "mounter", volOptions)
|
||||
|
||||
if err = opts.validate(); err != nil {
|
||||
|
Reference in New Issue
Block a user