mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
fix ineffassign and varcheck
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
26cc8e40a8
commit
07332ad398
@ -90,7 +90,7 @@ const (
|
||||
proxyModeUserspace = "userspace"
|
||||
proxyModeIPTables = "iptables"
|
||||
proxyModeIPVS = "ipvs"
|
||||
proxyModeKernelspace = "kernelspace" //nolint:deadcode
|
||||
proxyModeKernelspace = "kernelspace" //nolint:deadcode,varcheck
|
||||
)
|
||||
|
||||
// proxyRun defines the interface to run a specified ProxyServer
|
||||
|
@ -1696,7 +1696,7 @@ func TestCSIDriverValidation(t *testing.T) {
|
||||
storageCapacity := true
|
||||
notStorageCapacity := false
|
||||
supportedFSGroupPolicy := storage.FileFSGroupPolicy
|
||||
invalidFSGroupPolicy := storage.ReadWriteOnceWithFSTypeFSGroupPolicy
|
||||
invalidFSGroupPolicy := storage.ReadWriteOnceWithFSTypeFSGroupPolicy //nolint:ineffassign
|
||||
invalidFSGroupPolicy = "invalid-mode"
|
||||
successCases := []storage.CSIDriver{
|
||||
{
|
||||
@ -2051,7 +2051,7 @@ func TestCSIDriverValidationUpdate(t *testing.T) {
|
||||
{
|
||||
name: "FSGroupPolicy invalidated",
|
||||
modify: func(new *storage.CSIDriver) {
|
||||
invalidFSGroupPolicy := storage.ReadWriteOnceWithFSTypeFSGroupPolicy
|
||||
invalidFSGroupPolicy := storage.ReadWriteOnceWithFSTypeFSGroupPolicy //nolint:ineffassign
|
||||
invalidFSGroupPolicy = "invalid"
|
||||
new.Spec.FSGroupPolicy = &invalidFSGroupPolicy
|
||||
},
|
||||
|
@ -59,7 +59,7 @@ func output() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("error serializing api definitions: %w", err)
|
||||
}
|
||||
_, err = os.Stdout.Write(data)
|
||||
_, _ = os.Stdout.Write(data)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -244,11 +244,6 @@ var _ = SIGDescribe("Pods", func() {
|
||||
pods, err := podClient.List(context.TODO(), options)
|
||||
framework.ExpectNoError(err, "failed to query for pods")
|
||||
framework.ExpectEqual(len(pods.Items), 0)
|
||||
options = metav1.ListOptions{
|
||||
LabelSelector: selector.String(),
|
||||
ResourceVersion: pods.ListMeta.ResourceVersion,
|
||||
}
|
||||
|
||||
listCompleted := make(chan bool, 1)
|
||||
lw := &cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
|
@ -78,6 +78,7 @@ var _ = lifecycle.SIGDescribe("[Feature:BootstrapTokens]", func() {
|
||||
|
||||
ginkgo.By("wait for the bootstrap token secret be signed")
|
||||
err = WaitforSignedClusterInfoByBootStrapToken(c, tokenID)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
cfgMap, err := f.ClientSet.CoreV1().ConfigMaps(metav1.NamespacePublic).Get(context.TODO(), bootstrapapi.ConfigMapClusterInfo, metav1.GetOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
|
@ -83,6 +83,7 @@ var _ = SIGDescribe("Events", func() {
|
||||
selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value}))
|
||||
options := metav1.ListOptions{LabelSelector: selector.String()}
|
||||
pods, err := podClient.List(context.TODO(), options)
|
||||
framework.ExpectNoError(err)
|
||||
framework.ExpectEqual(len(pods.Items), 1)
|
||||
|
||||
ginkgo.By("retrieving the pod")
|
||||
|
@ -78,10 +78,6 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
pods, err := podClient.List(context.TODO(), options)
|
||||
framework.ExpectNoError(err, "failed to query for pod")
|
||||
framework.ExpectEqual(len(pods.Items), 0)
|
||||
options = metav1.ListOptions{
|
||||
LabelSelector: selector.String(),
|
||||
ResourceVersion: pods.ListMeta.ResourceVersion,
|
||||
}
|
||||
|
||||
ginkgo.By("submitting the pod to kubernetes")
|
||||
podClient.Create(pod)
|
||||
|
@ -72,11 +72,6 @@ var _ = SIGDescribe("LimitRange", func() {
|
||||
limitRanges, err := f.ClientSet.CoreV1().LimitRanges(f.Namespace.Name).List(context.TODO(), options)
|
||||
framework.ExpectNoError(err, "failed to query for limitRanges")
|
||||
framework.ExpectEqual(len(limitRanges.Items), 0)
|
||||
options = metav1.ListOptions{
|
||||
LabelSelector: selector.String(),
|
||||
ResourceVersion: limitRanges.ListMeta.ResourceVersion,
|
||||
}
|
||||
|
||||
listCompleted := make(chan bool, 1)
|
||||
lw := &cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
|
@ -61,7 +61,7 @@ const (
|
||||
func TestConcurrentEvictionRequests(t *testing.T) {
|
||||
podNameFormat := "test-pod-%d"
|
||||
|
||||
s, closeFn, rm, informers, clientSet := rmSetup(t)
|
||||
s, closeFn, rm, informers, _ := rmSetup(t)
|
||||
defer closeFn()
|
||||
|
||||
ns := framework.CreateTestingNamespace("concurrent-eviction-requests", s, t)
|
||||
@ -180,7 +180,7 @@ func TestConcurrentEvictionRequests(t *testing.T) {
|
||||
|
||||
// TestTerminalPodEviction ensures that PDB is not checked for terminal pods.
|
||||
func TestTerminalPodEviction(t *testing.T) {
|
||||
s, closeFn, rm, informers, clientSet := rmSetup(t)
|
||||
s, closeFn, rm, informers, _ := rmSetup(t)
|
||||
defer closeFn()
|
||||
|
||||
ns := framework.CreateTestingNamespace("terminalpod-eviction", s, t)
|
||||
|
Loading…
Reference in New Issue
Block a user