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