Fix go lint errors (#1468)

* fix linter errors
* fix linter errors in kubectl plugin
* update PyYAML dependency in e2e tests
* declare a testVolume in volume_test
This commit is contained in:
Felix Kunde
2021-05-10 11:48:03 +02:00
committed by GitHub
parent 32e6c135b9
commit f0f7f25d30
17 changed files with 122 additions and 154 deletions
+8 -7
View File
@@ -23,13 +23,14 @@ THE SOFTWARE.
package cmd
import (
"log"
"os"
user "os/user"
"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/remotecommand"
"log"
"os"
user "os/user"
)
// connectCmd represents the kubectl pg connect command
@@ -80,13 +81,13 @@ kubectl pg connect -c cluster -p -u user01 -d db01
func connect(clusterName string, master bool, replica string, psql bool, user string, dbName string) {
config := getConfig()
client, er := kubernetes.NewForConfig(config)
if er != nil {
log.Fatal(er)
client, err := kubernetes.NewForConfig(config)
if err != nil {
log.Fatal(err)
}
podName := getPodName(clusterName, master, replica)
execRequest := &rest.Request{}
var execRequest *rest.Request
if psql {
execRequest = client.CoreV1().RESTClient().Post().Resource("pods").