Skip to content

Commit

Permalink
Merge pull request #1610 from tahsinrahman/enable-gosec
Browse files Browse the repository at this point in the history
🏃 Enable `gosec` linter in golangci-lint
  • Loading branch information
k8s-ci-robot authored Oct 17, 2019
2 parents 2b01b82 + 2734fb6 commit fff5086
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ linters:
- lll
- godox
- wsl
- gosec
- whitespace
- gocognit
# Run with --fast=false for more extensive checks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ func (c *client) kubectlApply(manifest string) error {
}

func (c *client) kubectlManifestCmd(commandName, manifest string) error {
cmd := exec.Command("kubectl", c.buildKubectlArgs(commandName)...)
cmd := exec.Command("kubectl", c.buildKubectlArgs(commandName)...) //nolint:gosec
cmd.Stdin = strings.NewReader(manifest)
out, err := cmd.CombinedOutput()
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions test/helpers/kind/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Cluster struct {
}

// Setup creates a kind cluster and returns a path to the kubeconfig
// nolint:gosec
func (c *Cluster) Setup() {
var err error
c.tmpDir, err = ioutil.TempDir("", "kind-home")
Expand All @@ -63,7 +64,7 @@ func (c *Cluster) Setup() {

// Teardown attempts to delete the KIND cluster
func (c *Cluster) Teardown() {
c.run(exec.Command(*kindBinary, "delete", "cluster", "--name", c.Name))
c.run(exec.Command(*kindBinary, "delete", "cluster", "--name", c.Name)) //nolint:gosec
os.RemoveAll(c.tmpDir)
}

Expand All @@ -73,12 +74,12 @@ func (c *Cluster) LoadImage(image string) {
ginkgo.GinkgoWriter,
"loading image %q into Kind node\n",
image)
c.run(exec.Command(*kindBinary, "load", "docker-image", "--name", c.Name, image))
c.run(exec.Command(*kindBinary, "load", "docker-image", "--name", c.Name, image)) //nolint:gosec
}

// ApplyYAML applies the provided manifest to the kind cluster
func (c *Cluster) ApplyYAML(manifestPath string) {
c.run(exec.Command(
c.run(exec.Command( //nolint:gosec
*kubectlBinary,
"create",
"--kubeconfig="+c.kubepath,
Expand Down

0 comments on commit fff5086

Please sign in to comment.