Skip to content

Commit

Permalink
build, linter, errcheck: lint tests/virtctl
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Aug 4, 2022
1 parent e62fc06 commit 08544c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion nogo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
"tests/network/": "tests/network/ pkg does not pass errcheck yet",
"tests/reporter/": "tests/reporter pkg does not pass errcheck yet",
"tests/storage/": "tests/storage/ pkg does not pass errcheck yet",
"tests/virtctl/": "tests/virtctl/ pkg does not pass errcheck yet",
"tests/canary_upgrade_test.go": "canary_upgrade_test does not pass errcheck yet",
"tests/infra_test.go": "infra_test.go does not pass errcheck yet",
"tests/kubectl_test.go": "kubectl_test does not pass errcheck yet",
Expand Down
1 change: 1 addition & 0 deletions tests/virtctl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
"//tests:go_default_library",
"//tests/clientcmd:go_default_library",
"//tests/console:go_default_library",
"//tests/errorhandling:go_default_library",
"//tests/libvmi:go_default_library",
"//tests/util:go_default_library",
"//vendor/github.com/onsi/ginkgo/v2:go_default_library",
Expand Down
4 changes: 3 additions & 1 deletion tests/virtctl/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"os"

"golang.org/x/crypto/ssh"

"kubevirt.io/kubevirt/tests/errorhandling"
)

func NewKeyPair() (*ecdsa.PrivateKey, ssh.PublicKey, error) {
Expand Down Expand Up @@ -37,7 +39,7 @@ func DumpPrivateKey(privateKey *ecdsa.PrivateKey, file string) error {
if err != nil {
return err
}
defer f.Close()
defer errorhandling.SafelyCloseFile(f)
if err = pem.Encode(f, privateKeyBlock); err != nil {
return fmt.Errorf("error when encode private pem: %s", err)

Expand Down

0 comments on commit 08544c7

Please sign in to comment.