mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Fix staticcheck in test/integration/{examples,framework}
Part of #92402, fixes staticcheck failures SA1006, SA1019 and SA2002 in test/integration/examples and test/integration/framework.
This commit is contained in:
parent
568cd3df0b
commit
3cbdc711de
@ -3,8 +3,6 @@ pkg/controller/replicaset
|
|||||||
pkg/kubelet/dockershim
|
pkg/kubelet/dockershim
|
||||||
pkg/volume/testing
|
pkg/volume/testing
|
||||||
test/e2e/autoscaling
|
test/e2e/autoscaling
|
||||||
test/integration/examples
|
|
||||||
test/integration/framework
|
|
||||||
test/integration/garbagecollector
|
test/integration/garbagecollector
|
||||||
test/integration/scheduler_perf
|
test/integration/scheduler_perf
|
||||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||||
|
@ -90,7 +90,7 @@ func TestAggregatedAPIServer(t *testing.T) {
|
|||||||
"--kubeconfig", wardleToKASKubeConfigFile,
|
"--kubeconfig", wardleToKASKubeConfigFile,
|
||||||
})
|
})
|
||||||
if err := wardleCmd.Execute(); err != nil {
|
if err := wardleCmd.Execute(); err != nil {
|
||||||
t.Fatal(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
directWardleClientConfig, err := waitForWardleRunning(t, kubeClientConfig, wardleCertDir, wardlePort)
|
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
|
// 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 = 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)
|
hasExpectedError := checkWardleUnavailableDiscoveryError(t, err)
|
||||||
return hasExpectedError, nil
|
return hasExpectedError, nil
|
||||||
})
|
})
|
||||||
|
@ -100,7 +100,7 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
|
|||||||
// TODO: Check for valid etcd version.
|
// TODO: Check for valid etcd version.
|
||||||
etcdPath, err := getEtcdPath()
|
etcdPath, err := getEtcdPath()
|
||||||
if err != nil {
|
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)
|
return "", nil, fmt.Errorf("could not find etcd in PATH: %v", err)
|
||||||
}
|
}
|
||||||
etcdPort, err := getAvailablePort()
|
etcdPort, err := getAvailablePort()
|
||||||
|
@ -127,7 +127,7 @@ func StartTestServer(t *testing.T, stopCh <-chan struct{}, setup TestServerSetup
|
|||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
if err := kubeAPIServer.GenericAPIServer.PrepareRun().Run(stopCh); err != nil {
|
if err := kubeAPIServer.GenericAPIServer.PrepareRun().Run(stopCh); err != nil {
|
||||||
t.Fatal(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user