mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
Enable more linters for new code
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
)
|
||||
|
||||
var _ FileSystem = fsOnDisk{}
|
||||
@@ -128,7 +130,7 @@ func (fsOnDisk) ReadFile(name string) ([]byte, error) { return ioutil.ReadFile(n
|
||||
|
||||
// WriteFile delegates to ioutil.WriteFile with read/write permissions.
|
||||
func (fsOnDisk) WriteFile(name string, c []byte) error {
|
||||
return ioutil.WriteFile(name, c, 0666) //nolint:gosec
|
||||
return errors.Wrap(ioutil.WriteFile(name, c, 0666)) //nolint:gosec
|
||||
}
|
||||
|
||||
// Walk delegates to filepath.Walk.
|
||||
|
||||
@@ -317,7 +317,7 @@ func toTypeMeta(ext interface{}) (yaml.TypeMeta, bool) {
|
||||
}
|
||||
|
||||
apiVersion := m[versionKey].(string)
|
||||
if g := m[groupKey].(string); g != "" {
|
||||
if g, ok := m[groupKey].(string); ok && g != "" {
|
||||
apiVersion = g + "/" + apiVersion
|
||||
}
|
||||
return yaml.TypeMeta{Kind: m[kindKey].(string), APIVersion: apiVersion}, true
|
||||
|
||||
Reference in New Issue
Block a user