Merge pull request #97295 from tiloso/staticcheck-test-integration

Fix staticcheck in test/integration/{examples,framework}
This commit is contained in:
Kubernetes Prow Robot 2021-02-01 04:49:48 -08:00 committed by GitHub
commit 101cdbf932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 6 deletions

View File

@ -2,8 +2,6 @@ cluster/images/etcd/migrate
pkg/controller/replicaset
pkg/kubelet/dockershim
test/e2e/autoscaling
test/integration/examples
test/integration/framework
test/integration/garbagecollector
test/integration/scheduler_perf
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip

View File

@ -90,7 +90,7 @@ func TestAggregatedAPIServer(t *testing.T) {
"--kubeconfig", wardleToKASKubeConfigFile,
})
if err := wardleCmd.Execute(); err != nil {
t.Fatal(err)
t.Error(err)
}
}()
directWardleClientConfig, err := waitForWardleRunning(t, kubeClientConfig, wardleCertDir, wardlePort)
@ -131,7 +131,7 @@ func TestAggregatedAPIServer(t *testing.T) {
// wait for the unavailable API service to be processed with updated status
err = wait.Poll(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
_, err = kubeClient.Discovery().ServerResources()
_, _, err = kubeClient.Discovery().ServerGroupsAndResources()
hasExpectedError := checkWardleUnavailableDiscoveryError(t, err)
return hasExpectedError, nil
})

View File

@ -100,7 +100,7 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
// TODO: Check for valid etcd version.
etcdPath, err := getEtcdPath()
if err != nil {
fmt.Fprintf(os.Stderr, installEtcd)
fmt.Fprint(os.Stderr, installEtcd)
return "", nil, fmt.Errorf("could not find etcd in PATH: %v", err)
}
etcdPort, err := getAvailablePort()

View File

@ -127,7 +127,7 @@ func StartTestServer(t *testing.T, stopCh <-chan struct{}, setup TestServerSetup
}
go func() {
if err := kubeAPIServer.GenericAPIServer.PrepareRun().Run(stopCh); err != nil {
t.Fatal(err)
t.Error(err)
}
}()