-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable govet linter; disable vet in make verify #1810
Enable govet linter; disable vet in make verify #1810
Conversation
Hi @alexandear. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
ad8a11f
to
6159fda
Compare
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically lgtm
.golangci.yaml
Outdated
disable: | ||
- fieldalignment | ||
- shadow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to disable these linters?
As I can see Kubernetes repository, these linters are enabled: https://github.com/kubernetes/kubernetes/blob/master/hack/golangci.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubernetes repository does not specify configuration options for the govet
. This leads golangci-lint to enabling only default analyzers https://github.com/golangci/golangci-lint/blob/v1.56.2/pkg/golinters/govet.go#L103-L136:
32 analyzers: [appends asmdecl assign atomic bools buildtag cgocall composites copylocks defers directive errorsas framepointer httpresponse ifaceassert loopclosure lostcancel nilfunc printf shift sigchanyzer slog stdmethods stringintconv structtag testinggoroutine tests timeformat unmarshal unreachable unsafeptr unusedresult]
This PR enables a few more: all available analyzers except non-default shadow
and fieldalignment
:
39 analyzers: [appends asmdecl assign atomic atomicalign bools buildtag cgocall composites copylocks deepequalerrors defers directive errorsas findcall framepointer httpresponse ifaceassert loopclosure lostcancel nilfunc nilness printf reflectvaluecompare shift sigchanyzer slog sortslice stdmethods stringintconv structtag testinggoroutine tests timeformat unmarshal unreachable unsafeptr unusedresult unusedwrite]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can enable fieldalignment
, shadow
analyzers and fix all 194 new govet
issues. Should I do this?
The whole list of issues is
apis/kueue/v1beta1/admissioncheck_types.go:49:25: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type AdmissionCheckSpec struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:26:23: fieldalignment: struct with 112 pointer bytes could be 96 (govet)
type ClusterQueueSpec struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:175:20: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type ResourceQuota struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:223:25: fieldalignment: struct with 96 pointer bytes could be 64 (govet)
type ClusterQueueStatus struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:270:41: fieldalignment: struct with 48 pointer bytes could be 32 (govet)
type ClusterQueuePendingWorkloadsStatus struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:411:25: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type BorrowWithinCohort struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:446:19: fieldalignment: struct with 472 pointer bytes could be 456 (govet)
type ClusterQueue struct {
^
apis/kueue/v1beta1/localqueue_types.go:35:23: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
type LocalQueueStatus struct {
^
apis/kueue/v1beta1/workload_types.go:25:19: fieldalignment: struct with 88 pointer bytes could be 72 (govet)
type WorkloadSpec struct {
^
apis/kueue/v1beta1/workload_types.go:85:23: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type PodSetAssignment struct {
^
apis/kueue/v1beta1/workload_types.go:110:13: fieldalignment: struct with 808 pointer bytes could be 784 (govet)
type PodSet struct {
^
apis/kueue/v1beta1/workloadpriorityclass_types.go:31:28: fieldalignment: struct with 280 pointer bytes could be 264 (govet)
type WorkloadPriorityClass struct {
^
apis/visibility/v1alpha1/types.go:64:22: fieldalignment: struct with 248 pointer bytes could be 232 (govet)
type PendingWorkload struct {
^
pkg/util/testing/client.go:81:20: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type EventRecorder struct {
^
pkg/util/testingjobs/jobset/wrappers.go:45:32: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
type ReplicatedJobRequirements struct {
^
test/integration/controller/jobs/kubeflow/kubeflowjob.go:57:24: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type PodsReadyTestSpec struct {
^
test/integration/framework/framework.go:52:16: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
type Framework struct {
^
apis/config/v1beta1/configuration_types.go:30:20: fieldalignment: struct with 240 pointer bytes could be 224 (govet)
type Configuration struct {
^
apis/config/v1beta1/configuration_types.go:75:24: fieldalignment: struct with 144 pointer bytes could be 128 (govet)
type ControllerManager struct {
^
apis/config/v1beta1/configuration_types.go:181:23: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type WaitForPodsReady struct {
^
apis/config/v1beta1/configuration_types.go:287:19: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type Integrations struct {
^
cmd/kueue/main_test.go:74:17: fieldalignment: struct with 288 pointer bytes could be 280 (govet)
testcases := []struct {
^
pkg/cache/cache.go:72:12: fieldalignment: struct with 144 pointer bytes could be 104 (govet)
type Cache struct {
^
pkg/cache/cache.go:546:29: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type ClusterQueueUsageStats struct {
^
pkg/cache/cache.go:605:27: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type LocalQueueUsageStats struct {
^
pkg/cache/clusterqueue.go:44:19: fieldalignment: struct of size 248 could be 240 (govet)
type ClusterQueue struct {
^
pkg/cache/clusterqueue.go:90:20: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type ResourceGroup struct {
^
pkg/cache/clusterqueue.go:100:19: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type FlavorQuotas struct {
^
pkg/cache/clusterqueue.go:105:20: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type ResourceQuota struct {
^
pkg/cache/clusterqueue.go:113:12: fieldalignment: struct with 48 pointer bytes could be 24 (govet)
type queue struct {
^
pkg/cache/cache_test.go:92:13: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := []struct {
^
pkg/cache/cache_test.go:1746:22: fieldalignment: struct with 72 pointer bytes could be 64 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2017:22: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2458:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2754:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:2999:13: fieldalignment: struct with 80 pointer bytes could be 72 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:3185:22: fieldalignment: struct of size 152 could be 144 (govet)
cases := map[string]struct {
^
pkg/cache/clusterqueue_test.go:92:22: fieldalignment: struct of size 32 could be 24 (govet)
cases := map[string]struct {
^
pkg/cache/snapshot_test.go:46:26: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
testCases := map[string]struct {
^
pkg/cache/snapshot_test.go:695:22: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
cases := map[string]struct {
^
pkg/config/config_test.go:342:17: fieldalignment: struct with 952 pointer bytes could be 944 (govet)
testcases := []struct {
^
pkg/controller/admissionchecks/multikueue/controllers.go:31:19: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type SetupOptions struct {
^
pkg/controller/admissionchecks/multikueue/multikueuecluster.go:72:19: fieldalignment: struct with 136 pointer bytes could be 104 (govet)
type remoteClient struct {
^
pkg/controller/admissionchecks/multikueue/multikueuecluster.go:295:25: fieldalignment: struct with 128 pointer bytes could be 88 (govet)
type clustersReconciler struct {
^
pkg/controller/admissionchecks/multikueue/admissioncheck_test.go:34:22: fieldalignment: struct with 128 pointer bytes could be 112 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/multikueue/workload_test.go:59:22: fieldalignment: struct with 360 pointer bytes could be 352 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/admissioncheck_reconciler_test.go:33:22: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/controller_test.go:244:22: fieldalignment: struct with 208 pointer bytes could be 200 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/controller_test.go:769:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/controller/core/clusterqueue_controller.go:61:29: fieldalignment: struct of size 152 could be 144 (govet)
type ClusterQueueReconciler struct {
^
❯ golangci-lint run
test/integration/controller/jobs/kubeflow/kubeflowjob.go:57:24: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type PodsReadyTestSpec struct {
^
pkg/controller/core/clusterqueue_controller.go:61:29: fieldalignment: struct of size 152 could be 144 (govet)
type ClusterQueueReconciler struct {
^
pkg/controller/core/clusterqueue_controller.go:77:36: fieldalignment: struct of size 48 could be 40 (govet)
type ClusterQueueReconcilerOptions struct {
^
pkg/controller/core/localqueue_controller.go:52:27: fieldalignment: struct with 64 pointer bytes could be 56 (govet)
type LocalQueueReconciler struct {
^
pkg/controller/core/workload_controller.go:66:14: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type options struct {
^
pkg/controller/core/workload_controller.go:105:25: fieldalignment: struct with 112 pointer bytes could be 96 (govet)
type WorkloadReconciler struct {
^
pkg/controller/core/clusterqueue_controller_test.go:51:26: fieldalignment: struct with 248 pointer bytes could be 240 (govet)
testCases := map[string]struct {
^
pkg/controller/core/clusterqueue_controller_test.go:499:26: fieldalignment: struct of size 32 could be 24 (govet)
testCases := map[string]struct {
^
pkg/controller/core/workload_controller_test.go:47:26: fieldalignment: struct with 448 pointer bytes could be 432 (govet)
testCases := map[string]struct {
^
pkg/controller/core/workload_controller.go:283:3: shadow: declaration of "err" shadows declaration at line 269 (govet)
err := workload.ApplyAdmissionStatus(ctx, r.client, wl, true)
^
pkg/controller/core/workload_controller.go:681:3: shadow: declaration of "log" shadows declaration at line 671 (govet)
log := log.WithValues("workload", klog.KObj(wlCopy))
^
pkg/controller/core/workload_controller.go:743:3: shadow: declaration of "log" shadows declaration at line 736 (govet)
log := log.WithValues("localQueue", klog.KObj(&lq))
^
pkg/controller/core/workload_controller.go:757:3: shadow: declaration of "log" shadows declaration at line 750 (govet)
log := log.WithValues("workload", klog.KObj(&wl))
^
apis/config/v1beta1/configuration_types.go:30:20: fieldalignment: struct with 240 pointer bytes could be 224 (govet)
type Configuration struct {
^
apis/config/v1beta1/configuration_types.go:75:24: fieldalignment: struct with 144 pointer bytes could be 128 (govet)
type ControllerManager struct {
^
apis/config/v1beta1/configuration_types.go:181:23: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type WaitForPodsReady struct {
^
apis/config/v1beta1/configuration_types.go:287:19: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type Integrations struct {
^
pkg/visibility/api/rest/test_utils.go:21:10: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type req struct {
^
pkg/visibility/api/rest/pending_workloads_cq_test.go:62:22: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
cases := map[string]struct {
^
pkg/visibility/api/rest/pending_workloads_lq_test.go:62:22: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
cases := map[string]struct {
^
test/integration/controller/jobs/job/job_controller_test.go:808:25: fieldalignment: struct with 136 pointer bytes could be 128 (govet)
type podsReadyTestSpec struct {
^
pkg/util/testing/client.go:81:20: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type EventRecorder struct {
^
pkg/cache/cache.go:72:12: fieldalignment: struct with 144 pointer bytes could be 104 (govet)
type Cache struct {
^
pkg/cache/cache.go:546:29: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type ClusterQueueUsageStats struct {
^
pkg/cache/cache.go:605:27: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type LocalQueueUsageStats struct {
^
pkg/cache/clusterqueue.go:44:19: fieldalignment: struct of size 248 could be 240 (govet)
type ClusterQueue struct {
^
pkg/cache/clusterqueue.go:90:20: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type ResourceGroup struct {
^
pkg/cache/clusterqueue.go:100:19: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type FlavorQuotas struct {
^
pkg/cache/clusterqueue.go:105:20: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type ResourceQuota struct {
^
pkg/cache/clusterqueue.go:113:12: fieldalignment: struct with 48 pointer bytes could be 24 (govet)
type queue struct {
^
pkg/cache/cache_test.go:92:13: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := []struct {
^
pkg/cache/cache_test.go:1746:22: fieldalignment: struct with 72 pointer bytes could be 64 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2017:22: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2458:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2754:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:2999:13: fieldalignment: struct with 80 pointer bytes could be 72 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:3185:22: fieldalignment: struct of size 152 could be 144 (govet)
cases := map[string]struct {
^
pkg/cache/clusterqueue_test.go:92:22: fieldalignment: struct of size 32 could be 24 (govet)
cases := map[string]struct {
^
pkg/cache/clusterqueue_test.go:415:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
cases := []struct {
^
pkg/cache/snapshot_test.go:46:26: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
testCases := map[string]struct {
^
pkg/cache/snapshot_test.go:695:22: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
cases := map[string]struct {
^
pkg/cache/cache.go:297:5: shadow: declaration of "err" shadows declaration at line 286 (govet)
if err := c.client.List(ctx, &queues, client.MatchingFields{utilindexer.QueueClusterQueueKey: cq.Name}); err != nil {
^
pkg/cache/cache_test.go:2284:4: shadow: declaration of "cq" shadows declaration at line 2283 (govet)
cq := cq.DeepCopy()
^
pkg/cache/cache_test.go:2296:4: shadow: declaration of "q" shadows declaration at line 2295 (govet)
q := q.DeepCopy()
^
pkg/cache/cache_test.go:2308:4: shadow: declaration of "wl" shadows declaration at line 2307 (govet)
wl := wl.DeepCopy()
^
pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller_test.go:312:22: fieldalignment: struct with 128 pointer bytes could be 112 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go:106:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go:243:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go:105:3: shadow: declaration of "cfg" shadows declaration at line 44 (govet)
cfg := fwk.Init()
^
❯ golangci-lint run
pkg/config/config_test.go:342:17: fieldalignment: struct with 952 pointer bytes could be 944 (govet)
testcases := []struct {
^
pkg/config/config_test.go:846:17: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
testcases := []struct {
^
pkg/config/config.go:160:3: shadow: declaration of "err" shadows declaration at line 151 (govet)
err := fromFile(configFile, scheme, &cfg)
^
pkg/util/parallelize/parallelize_test.go:31:22: fieldalignment: struct with 48 pointer bytes could be 32 (govet)
cases := map[string]struct {
^
test/integration/controller/admissionchecks/provisioning/provisioning_test.go:202:5: shadow: declaration of "updatedWl" shadows declaration at line 189 (govet)
updatedWl := &kueue.Workload{}
^
test/integration/controller/admissionchecks/provisioning/provisioning_test.go:427:5: shadow: declaration of "updatedWl" shadows declaration at line 414 (govet)
updatedWl := &kueue.Workload{}
^
test/integration/controller/jobs/jobset/jobset_controller_test.go:573:25: fieldalignment: struct with 88 pointer bytes could be 64 (govet)
type podsReadyTestSpec struct {
^
test/util/util.go:473:3: shadow: declaration of "v" shadows declaration at line 470 (govet)
v, err := testutil.GetGaugeMetricValue(metric)
^
test/util/util.go:482:3: shadow: declaration of "v" shadows declaration at line 479 (govet)
v, err := testutil.GetGaugeMetricValue(metric)
^
test/util/util.go:491:3: shadow: declaration of "v" shadows declaration at line 488 (govet)
v, err := testutil.GetGaugeMetricValue(metric)
^
test/util/util.go:500:3: shadow: declaration of "v" shadows declaration at line 497 (govet)
v, err := testutil.GetGaugeMetricValue(metric)
^
pkg/util/priority/priority_test.go:68:22: fieldalignment: struct with 80 pointer bytes could be 64 (govet)
tests := map[string]struct {
^
pkg/util/priority/priority_test.go:171:22: fieldalignment: struct with 80 pointer bytes could be 64 (govet)
tests := map[string]struct {
^
pkg/controller/core/clusterqueue_controller.go:61:29: fieldalignment: struct of size 152 could be 144 (govet)
type ClusterQueueReconciler struct {
^
pkg/controller/core/clusterqueue_controller.go:77:36: fieldalignment: struct of size 48 could be 40 (govet)
type ClusterQueueReconcilerOptions struct {
^
pkg/controller/core/localqueue_controller.go:52:27: fieldalignment: struct with 64 pointer bytes could be 56 (govet)
type LocalQueueReconciler struct {
^
pkg/controller/core/workload_controller.go:66:14: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type options struct {
^
pkg/controller/core/workload_controller.go:105:25: fieldalignment: struct with 112 pointer bytes could be 96 (govet)
type WorkloadReconciler struct {
^
pkg/controller/core/clusterqueue_controller_test.go:51:26: fieldalignment: struct with 248 pointer bytes could be 240 (govet)
testCases := map[string]struct {
^
pkg/controller/core/clusterqueue_controller_test.go:499:26: fieldalignment: struct of size 32 could be 24 (govet)
testCases := map[string]struct {
^
pkg/controller/core/workload_controller_test.go:47:26: fieldalignment: struct with 448 pointer bytes could be 432 (govet)
testCases := map[string]struct {
^
pkg/controller/core/workload_controller.go:283:3: shadow: declaration of "err" shadows declaration at line 269 (govet)
err := workload.ApplyAdmissionStatus(ctx, r.client, wl, true)
^
pkg/controller/core/workload_controller.go:681:3: shadow: declaration of "log" shadows declaration at line 671 (govet)
log := log.WithValues("workload", klog.KObj(wlCopy))
^
pkg/controller/core/workload_controller.go:743:3: shadow: declaration of "log" shadows declaration at line 736 (govet)
log := log.WithValues("localQueue", klog.KObj(&lq))
^
pkg/controller/core/workload_controller.go:757:3: shadow: declaration of "log" shadows declaration at line 750 (govet)
log := log.WithValues("workload", klog.KObj(&wl))
^
pkg/util/testingjobs/jobset/wrappers.go:45:32: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
type ReplicatedJobRequirements struct {
^
pkg/queue/cluster_queue_impl.go:40:23: fieldalignment: struct with 160 pointer bytes could be 104 (govet)
type clusterQueueBase struct {
^
pkg/queue/local_queue.go:37:17: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type LocalQueue struct {
^
pkg/queue/manager.go:63:14: fieldalignment: struct with 176 pointer bytes could be 128 (govet)
type Manager struct {
^
pkg/queue/cluster_queue_best_effort_fifo_test.go:32:22: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
tests := map[string]struct {
^
pkg/queue/cluster_queue_impl_test.go:260:22: fieldalignment: struct of size 168 could be 160 (govet)
tests := map[string]struct {
^
pkg/queue/manager_test.go:467:22: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
cases := map[string]struct {
^
pkg/queue/manager_test.go:600:22: fieldalignment: struct with 104 pointer bytes could be 80 (govet)
cases := map[string]struct {
^
pkg/queue/manager_test.go:797:13: fieldalignment: struct with 48 pointer bytes could be 32 (govet)
tests := []struct {
^
test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go:106:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/paddlejob/paddlejob_controller_test.go:243:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
pkg/scheduler/preemption/preemption.go:46:16: fieldalignment: struct with 56 pointer bytes could be 48 (govet)
type Preemptor struct {
^
pkg/scheduler/preemption/preemption_test.go:230:22: fieldalignment: struct with 144 pointer bytes could be 128 (govet)
cases := map[string]struct {
^
test/integration/controller/jobs/pod/pod_controller_test.go:153:5: shadow: declaration of "clusterQueue" shadows declaration at line 61 (govet)
clusterQueue := testing.MakeClusterQueue("cluster-queue").
^
test/integration/controller/jobs/pod/pod_controller_test.go:219:5: shadow: declaration of "clusterQueue" shadows declaration at line 61 (govet)
clusterQueue := testing.MakeClusterQueue("cluster-queue").
^
test/integration/controller/jobs/pod/pod_controller_test.go:284:6: shadow: declaration of "clusterQueue" shadows declaration at line 61 (govet)
clusterQueue := testing.MakeClusterQueue("cluster-queue").
^
test/integration/controller/jobs/pod/pod_controller_test.go:373:6: shadow: declaration of "ns" shadows declaration at line 98 (govet)
ns *corev1.Namespace
^
cmd/kueue/main_test.go:74:17: fieldalignment: struct with 288 pointer bytes could be 280 (govet)
testcases := []struct {
^
pkg/controller/jobs/pod/expectations.go:30:24: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type expectationsStore struct {
^
pkg/controller/jobs/pod/pod_controller.go:124:10: fieldalignment: struct of size 1288 could be 1280 (govet)
type Pod struct {
^
pkg/controller/jobs/pod/pod_webhook.go:63:17: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type PodWebhook struct {
^
pkg/controller/jobs/pod/pod_controller_test.go:87:26: fieldalignment: struct with 88 pointer bytes could be 72 (govet)
testCases := map[string]struct {
^
pkg/controller/jobs/pod/pod_controller_test.go:152:26: fieldalignment: struct with 208 pointer bytes could be 200 (govet)
testCases := map[string]struct {
^
pkg/controller/jobs/pod/pod_webhook_test.go:60:26: fieldalignment: struct with 64 pointer bytes could be 40 (govet)
testCases := map[string]struct {
^
pkg/controller/jobs/pod/pod_webhook_test.go:287:26: fieldalignment: struct with 48 pointer bytes could be 24 (govet)
testCases := map[string]struct {
^
pkg/controller/jobs/job/job_webhook.go:43:17: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type JobWebhook struct {
^
pkg/controller/jobs/job/job_controller_test.go:169:26: fieldalignment: struct with 80 pointer bytes could be 64 (govet)
testcases := map[string]struct {
^
pkg/controller/jobs/job/job_controller_test.go:411:22: fieldalignment: struct with 2656 pointer bytes could be 2640 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/job/job_webhook_test.go:56:17: fieldalignment: struct with 56 pointer bytes could be 48 (govet)
testcases := []struct {
^
pkg/controller/jobs/job/job_webhook_test.go:385:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
test/integration/framework/framework.go:52:16: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
type Framework struct {
^
pkg/webhooks/clusterqueue_webhook.go:159:3: shadow: declaration of "path" shadows declaration at line 153 (govet)
path := path.Index(i)
^
pkg/webhooks/clusterqueue_webhook.go:161:4: shadow: declaration of "path" shadows declaration at line 159 (govet)
path := path.Child("coveredResources").Index(j)
^
pkg/webhooks/clusterqueue_webhook.go:170:4: shadow: declaration of "path" shadows declaration at line 159 (govet)
path := path.Child("flavors").Index(j)
^
pkg/webhooks/clusterqueue_webhook.go:192:3: shadow: declaration of "path" shadows declaration at line 182 (govet)
path := path.Child("resources").Index(i)
^
pkg/util/testing/client.go:81:20: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type EventRecorder struct {
^
pkg/controller/jobframework/integrationmanager.go:68:25: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type integrationManager struct {
^
pkg/controller/jobframework/reconciler.go:70:14: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type Options struct {
^
pkg/controller/jobframework/integrationmanager_test.go:67:22: fieldalignment: struct with 192 pointer bytes could be 176 (govet)
cases := map[string]struct {
^
pkg/controller/jobframework/integrationmanager_test.go:241:22: fieldalignment: struct with 80 pointer bytes could be 64 (govet)
cases := map[string]struct {
^
pkg/controller/jobframework/setup_test.go:48:22: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/controller/jobframework/setup_test.go:113:22: fieldalignment: struct with 96 pointer bytes could be 88 (govet)
cases := map[string]struct {
^
pkg/controller/jobframework/reconciler.go:186:8: shadow: declaration of "err" shadows declaration at line 158 (govet)
var err error
^
pkg/controller/jobframework/reconciler.go:193:7: shadow: declaration of "err" shadows declaration at line 158 (govet)
if err := r.client.List(ctx, workloads, client.InNamespace(req.Namespace),
^
pkg/controller/jobframework/reconciler.go:200:4: shadow: declaration of "err" shadows declaration at line 158 (govet)
err := workload.RemoveFinalizer(ctx, r.client, &workloads.Items[i])
^
pkg/controller/jobframework/reconciler.go:234:23: shadow: declaration of "err" shadows declaration at line 158 (govet)
isParentJobManaged, err := r.IsParentJobManaged(ctx, job.Object(), req.Namespace)
^
pkg/controller/jobframework/reconciler.go:250:23: shadow: declaration of "err" shadows declaration at line 158 (govet)
if parentWorkload, err := r.getParentWorkload(ctx, job, object); err != nil {
^
test/integration/controller/jobs/rayjob/rayjob_controller_test.go:333:25: fieldalignment: struct with 480 pointer bytes could be 448 (govet)
type podsReadyTestSpec struct {
^
pkg/controller/jobs/raycluster/raycluster_controller_test.go:61:22: fieldalignment: struct with 3120 pointer bytes could be 3104 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/raycluster/raycluster_webhook_test.go:91:26: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
testcases := map[string]struct {
^
pkg/controller/jobs/raycluster/raycluster_webhook_test.go:143:26: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
testcases := map[string]struct {
^
test/integration/webhook/resourceflavor_test.go:38:6: shadow: declaration of "ns" shadows declaration at line 35 (govet)
var ns *corev1.Namespace
^
test/integration/controller/jobs/mxjob/mxjob_controller_test.go:108:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/mxjob/mxjob_controller_test.go:249:3: shadow: declaration of "cfg" shadows declaration at line 43 (govet)
cfg := fwk.Init()
^
pkg/controller/admissionchecks/provisioning/admissioncheck_reconciler_test.go:33:22: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/controller_test.go:244:22: fieldalignment: struct with 208 pointer bytes could be 200 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/controller_test.go:769:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/provisioning/controller.go:132:5: shadow: declaration of "err" shadows declaration at line 114 (govet)
if err := c.client.List(ctx, list, client.InNamespace(wl.Namespace), client.MatchingFields{RequestsOwnedByWorkloadKey: wl.Name}); client.IgnoreNotFound(err) != nil {
^
pkg/controller/admissionchecks/provisioning/controller.go:373:7: shadow: declaration of "err" shadows declaration at line 363 (govet)
if err := ctrl.SetControllerReference(request, newPt, c.client.Scheme()); err != nil {
^
pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_controller_test.go:246:22: fieldalignment: struct with 104 pointer bytes could be 88 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/paddlejob/paddlejob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_controller_test.go:312:22: fieldalignment: struct with 128 pointer bytes could be 112 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/mxjob/mxjob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
test/integration/controller/jobs/job/job_controller_test.go:808:25: fieldalignment: struct with 136 pointer bytes could be 128 (govet)
type podsReadyTestSpec struct {
^
test/integration/controller/jobs/raycluster/raycluster_controller_test.go:336:25: fieldalignment: struct with 360 pointer bytes could be 336 (govet)
type podsReadyTestSpec struct {
^
pkg/controller/jobframework/reconciler_test.go:45:22: fieldalignment: struct with 56 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/controller/jobframework/reconciler_test.go:105:22: fieldalignment: struct with 64 pointer bytes could be 56 (govet)
cases := map[string]struct {
^
pkg/podset/podset.go:39:17: fieldalignment: struct with 56 pointer bytes could be 48 (govet)
type PodSetInfo struct {
^
pkg/podset/podset_test.go:65:22: fieldalignment: struct with 112 pointer bytes could be 104 (govet)
cases := map[string]struct {
^
pkg/podset/podset_test.go:201:22: fieldalignment: struct of size 104 could be 96 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/jobset/jobset_controller_test.go:218:22: fieldalignment: struct with 104 pointer bytes could be 88 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/jobset/jobset_webhook_test.go:41:17: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
testcases := []struct {
^
pkg/controller/jobs/kubeflow/jobs/pytorchjob/pytorchjob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
pkg/controller/jobs/mpijob/mpijob_controller_test.go:203:22: fieldalignment: struct with 104 pointer bytes could be 88 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/mpijob/mpijob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
pkg/cache/cache.go:72:12: fieldalignment: struct with 144 pointer bytes could be 104 (govet)
type Cache struct {
^
pkg/cache/cache.go:546:29: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type ClusterQueueUsageStats struct {
^
pkg/cache/cache.go:605:27: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type LocalQueueUsageStats struct {
^
pkg/cache/clusterqueue.go:44:19: fieldalignment: struct of size 248 could be 240 (govet)
type ClusterQueue struct {
^
pkg/cache/clusterqueue.go:77:13: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type Cohort struct {
^
pkg/cache/clusterqueue.go:90:20: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type ResourceGroup struct {
^
pkg/cache/clusterqueue.go:100:19: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type FlavorQuotas struct {
^
pkg/cache/clusterqueue.go:105:20: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type ResourceQuota struct {
^
pkg/cache/clusterqueue.go:113:12: fieldalignment: struct with 48 pointer bytes could be 24 (govet)
type queue struct {
^
pkg/cache/cache_test.go:92:13: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := []struct {
^
pkg/cache/cache_test.go:1746:22: fieldalignment: struct with 72 pointer bytes could be 64 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2017:22: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2458:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/cache/cache_test.go:2754:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:2999:13: fieldalignment: struct with 80 pointer bytes could be 72 (govet)
tests := []struct {
^
pkg/cache/cache_test.go:3185:22: fieldalignment: struct of size 152 could be 144 (govet)
cases := map[string]struct {
^
pkg/cache/clusterqueue_test.go:92:22: fieldalignment: struct of size 32 could be 24 (govet)
cases := map[string]struct {
^
pkg/cache/clusterqueue_test.go:415:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
cases := []struct {
^
pkg/cache/snapshot_test.go:46:26: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
testCases := map[string]struct {
^
pkg/cache/snapshot_test.go:695:22: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
cases := map[string]struct {
^
pkg/cache/cache.go:297:5: shadow: declaration of "err" shadows declaration at line 286 (govet)
if err := c.client.List(ctx, &queues, client.MatchingFields{utilindexer.QueueClusterQueueKey: cq.Name}); err != nil {
^
pkg/cache/cache_test.go:2284:4: shadow: declaration of "cq" shadows declaration at line 2283 (govet)
cq := cq.DeepCopy()
^
pkg/cache/cache_test.go:2296:4: shadow: declaration of "q" shadows declaration at line 2295 (govet)
q := q.DeepCopy()
^
pkg/cache/cache_test.go:2308:4: shadow: declaration of "wl" shadows declaration at line 2307 (govet)
wl := wl.DeepCopy()
^
pkg/util/heap/heap.go:37:19: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type itemKeyValue struct {
^
pkg/util/heap/heap.go:44:11: fieldalignment: struct with 48 pointer bytes could be 32 (govet)
type data struct {
^
pkg/util/heap/heap_test.go:30:21: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type testHeapObject struct {
^
test/integration/controller/core/workload_controller_test.go:190:4: shadow: declaration of "wl" shadows declaration at line 47 (govet)
wl := testing.MakeWorkload("wl", ns.Name).Queue("queue").Obj()
^
test/integration/controller/core/workload_controller_test.go:243:4: shadow: declaration of "wl" shadows declaration at line 47 (govet)
wl := testing.MakeWorkload("wl", ns.Name).Queue("queue").Obj()
^
test/integration/controller/core/workload_controller_test.go:281:4: shadow: declaration of "wl" shadows declaration at line 47 (govet)
wl := testing.MakeWorkload("wl", ns.Name).Queue("queue").Obj()
^
pkg/controller/admissionchecks/multikueue/controllers.go:31:19: fieldalignment: struct with 16 pointer bytes could be 8 (govet)
type SetupOptions struct {
^
pkg/controller/admissionchecks/multikueue/multikueuecluster.go:72:19: fieldalignment: struct with 136 pointer bytes could be 104 (govet)
type remoteClient struct {
^
pkg/controller/admissionchecks/multikueue/multikueuecluster.go:295:25: fieldalignment: struct with 128 pointer bytes could be 88 (govet)
type clustersReconciler struct {
^
pkg/controller/admissionchecks/multikueue/admissioncheck_test.go:34:22: fieldalignment: struct with 128 pointer bytes could be 112 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/multikueue/workload_test.go:59:22: fieldalignment: struct with 360 pointer bytes could be 352 (govet)
cases := map[string]struct {
^
pkg/controller/admissionchecks/multikueue/multikueuecluster.go:403:6: shadow: declaration of "err" shadows declaration at line 401 (govet)
if err := c.updateStatus(ctx, cluster, false, "ClientConnectionFailed", err.Error()); err != nil {
^
pkg/controller/admissionchecks/multikueue/workload.go:323:3: shadow: declaration of "acs" shadows declaration at line 249 (govet)
acs := workload.FindAdmissionCheck(group.local.Status.AdmissionChecks, group.acName)
^
apis/visibility/v1alpha1/types.go:64:22: fieldalignment: struct with 248 pointer bytes could be 232 (govet)
type PendingWorkload struct {
^
pkg/visibility/api/rest/test_utils.go:21:10: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type req struct {
^
pkg/visibility/api/rest/pending_workloads_cq_test.go:62:22: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
cases := map[string]struct {
^
pkg/visibility/api/rest/pending_workloads_lq_test.go:62:22: fieldalignment: struct with 96 pointer bytes could be 80 (govet)
cases := map[string]struct {
^
apis/config/v1beta1/configuration_types.go:30:20: fieldalignment: struct with 240 pointer bytes could be 224 (govet)
type Configuration struct {
^
apis/config/v1beta1/configuration_types.go:75:24: fieldalignment: struct with 144 pointer bytes could be 128 (govet)
type ControllerManager struct {
^
apis/config/v1beta1/configuration_types.go:181:23: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type WaitForPodsReady struct {
^
apis/config/v1beta1/configuration_types.go:287:19: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type Integrations struct {
^
test/integration/controller/jobs/mpijob/mpijob_controller_test.go:596:25: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type podsReadyTestSpec struct {
^
pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_controller_test.go:244:22: fieldalignment: struct with 104 pointer bytes could be 88 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/xgboostjob/xgboostjob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
pkg/scheduler/scheduler.go:537:20: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type entryOrdering struct {
^
pkg/scheduler/scheduler_test.go:227:22: fieldalignment: struct with 160 pointer bytes could be 152 (govet)
cases := map[string]struct {
^
pkg/scheduler/scheduler_test.go:1536:23: fieldalignment: struct with 48 pointer bytes could be 40 (govet)
for _, tc := range []struct {
^
pkg/scheduler/scheduler_test.go:1703:13: fieldalignment: struct with 136 pointer bytes could be 120 (govet)
cases := []struct {
^
pkg/scheduler/scheduler_test.go:2152:13: fieldalignment: struct with 56 pointer bytes could be 32 (govet)
cases := []struct {
^
pkg/scheduler/scheduler.go:230:3: shadow: declaration of "log" shadows declaration at line 175 (govet)
log := log.WithValues("workload", klog.KObj(e.Obj), "clusterQueue", klog.KRef("", e.ClusterQueue))
^
pkg/scheduler/scheduler.go:231:3: shadow: declaration of "ctx" shadows declaration at line 174 (govet)
ctx := ctrl.LoggerInto(ctx, log)
^
pkg/scheduler/scheduler.go:311:3: shadow: declaration of "log" shadows declaration at line 308 (govet)
log := log.WithValues("workload", klog.KObj(w.Obj), "clusterQueue", klog.KRef("", w.ClusterQueue))
^
pkg/workload/workload.go:95:11: fieldalignment: struct with 56 pointer bytes could be 40 (govet)
type Info struct {
^
pkg/workload/workload.go:105:22: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type PodSetResources struct {
^
pkg/workload/resources_test.go:30:22: fieldalignment: struct with 64 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
pkg/workload/workload_test.go:38:22: fieldalignment: struct with 496 pointer bytes could be 480 (govet)
cases := map[string]struct {
^
pkg/workload/workload_test.go:531:22: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go:105:3: shadow: declaration of "cfg" shadows declaration at line 44 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go:338:3: shadow: declaration of "cfg" shadows declaration at line 44 (govet)
cfg := fwk.Init()
^
test/integration/controller/jobs/pytorchjob/pytorchjob_controller_test.go:475:3: shadow: declaration of "cfg" shadows declaration at line 44 (govet)
cfg := fwk.Init()
^
apis/kueue/v1beta1/admissioncheck_types.go:49:25: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
type AdmissionCheckSpec struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:26:23: fieldalignment: struct with 112 pointer bytes could be 96 (govet)
type ClusterQueueSpec struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:175:20: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type ResourceQuota struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:223:25: fieldalignment: struct with 96 pointer bytes could be 64 (govet)
type ClusterQueueStatus struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:270:41: fieldalignment: struct with 48 pointer bytes could be 32 (govet)
type ClusterQueuePendingWorkloadsStatus struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:411:25: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type BorrowWithinCohort struct {
^
apis/kueue/v1beta1/clusterqueue_types.go:446:19: fieldalignment: struct with 472 pointer bytes could be 456 (govet)
type ClusterQueue struct {
^
apis/kueue/v1beta1/localqueue_types.go:35:23: fieldalignment: struct with 72 pointer bytes could be 56 (govet)
type LocalQueueStatus struct {
^
apis/kueue/v1beta1/workload_types.go:25:19: fieldalignment: struct with 88 pointer bytes could be 72 (govet)
type WorkloadSpec struct {
^
apis/kueue/v1beta1/workload_types.go:85:23: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type PodSetAssignment struct {
^
apis/kueue/v1beta1/workload_types.go:110:13: fieldalignment: struct with 808 pointer bytes could be 784 (govet)
type PodSet struct {
^
apis/kueue/v1beta1/workloadpriorityclass_types.go:31:28: fieldalignment: struct with 280 pointer bytes could be 264 (govet)
type WorkloadPriorityClass struct {
^
pkg/controller/jobs/rayjob/rayjob_controller_test.go:154:22: fieldalignment: struct with 88 pointer bytes could be 72 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/rayjob/rayjob_webhook_test.go:94:26: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
testcases := map[string]struct {
^
pkg/controller/jobs/rayjob/rayjob_webhook_test.go:174:26: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
testcases := map[string]struct {
^
pkg/util/limitrange/limitrange_test.go:39:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/util/slices/slices_test.go:27:22: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
cases := map[string]struct {
^
pkg/controller/jobs/kubeflow/jobs/tfjob/tfjob_webhook_test.go:30:26: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
testcases := map[string]struct {
^
pkg/util/admissioncheck/admissioncheck.go:42:44: fieldalignment: struct with 48 pointer bytes could be 40 (govet)
type ConfigHelper[PtrT objAsPtr[T], T any] struct {
^
pkg/util/admissioncheck/admissioncheck_test.go:49:22: fieldalignment: struct with 56 pointer bytes could be 48 (govet)
cases := map[string]struct {
^
test/e2e/singlecluster/e2e_test.go:299:5: shadow: declaration of "jobKey" shadows declaration at line 46 (govet)
jobKey := client.ObjectKeyFromObject(job)
^
test/e2e/singlecluster/e2e_test.go:393:5: shadow: declaration of "jobKey" shadows declaration at line 46 (govet)
jobKey := client.ObjectKeyFromObject(sampleJob)
^
test/integration/scheduler/scheduler_test.go:1262:4: shadow: declaration of "devCQ" shadows declaration at line 1223 (govet)
devCQ := testing.MakeClusterQueue("dev-cq").
^
test/integration/controller/jobs/kubeflow/kubeflowjob.go:57:24: fieldalignment: struct with 88 pointer bytes could be 80 (govet)
type PodsReadyTestSpec struct {
^
pkg/scheduler/flavorassigner/flavorassigner.go:41:17: fieldalignment: struct with 88 pointer bytes could be 48 (govet)
type Assignment struct {
^
pkg/scheduler/flavorassigner/flavorassigner.go:108:13: fieldalignment: struct with 40 pointer bytes could be 24 (govet)
type Status struct {
^
pkg/scheduler/flavorassigner/flavorassigner.go:152:23: fieldalignment: struct with 40 pointer bytes could be 32 (govet)
type PodSetAssignment struct {
^
pkg/scheduler/flavorassigner/podset_reducer.go:29:27: fieldalignment: struct with 88 pointer bytes could be 64 (govet)
type PodSetReducer[R any] struct {
^
pkg/scheduler/flavorassigner/flavorassigner_test.go:60:22: fieldalignment: struct with 392 pointer bytes could be 360 (govet)
cases := map[string]struct {
^
pkg/scheduler/flavorassigner/flavorassigner_test.go:2307:13: fieldalignment: struct with 32 pointer bytes could be 24 (govet)
tests := []struct {
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Maybe don't
enable_all
and enable specific additional linters. fieldalignment
- is definitely overkillshadow
- could be helpful at times
Besides this we should check the check time overhead added by the linters , verify currently being the longest CI job we run.
It will be nice if you cold try to make the 1000 lines comment above, collapsible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- OK, I changed the configuration to run golangci-lint with
govet
that has enabled default analyzers +nilness
. - Agree.
- We can enable and fix
shadow
issues in a separate PR.
Also, I remove vet
from verify
make target:
.PHONY: verify
verify: gomod-verify ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref prepare-release-branch
git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/
This is because running go vet ./...
is equivalent to running golangci-lint with the govet
linter. This should remove doing the same work twice.
You might ask, "Why can't we simply use go vet
instead of golangci-lint
with govet
? It will run default analyzers." The answer is: "go vet
cannot easily run custom analyzers like nilness
" (see this golang/go#59714)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the reason why we need to disable some linters, but I'm not confident that we should use the golangci-lint vet instead of the built-in vet since the standard vet is more generic.
@alculquicondor WDYT about using the golangci-lint vet instead of the built-in go vet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this comment, I'm ok with this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzen-y Could you please guide the next steps for this PR? Do I need to create a similar PR in the k/k?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexandear Currently, ready for merge :)
I was waited for resolved conflicts.
6159fda
to
1a28a2d
Compare
I'm ok enabling this, given that k/k seems to be going in a similar direction. |
1a28a2d
to
ab600cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
/approve
LGTM label has been added. Git tree hash: 0110b1766346c34830bebb92a6acbf9e58aafa06
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexandear, tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The PR enables
govet
, removesvet
fromverify
make target; fixesgovet.nilness
issue.Which issue(s) this PR fixes:
Special notes for your reviewer:
govet
is enabled in the https://github.com/kubernetes/kubernetes/blob/e0621034bedeeabe83383e5c300cf2d4fb616f36/hack/golangci.yaml#L136, so I've also enabled it here with all default analyzers andnilness
analyzer.So, the whole enabled
govet
analyzers list looks like this:Note, that debug flag
GL_DEBUG=govet
was added to golangci-lint today and will be available with golangci-lint v1.57.0 (not yet released).To speed up CI, the PR removes
vet
make target fromverify
. This is because runninggo vet ./...
is equivalent to running golangci-lint with thegovet
linter.Additionally, this PR removes the unnecessary check for
nil
detected by thegovet.nilness
:Does this PR introduce a user-facing change?