Repository: kubernetes-sigs/kueue

Issue:
Upgrade golangci-lint version to v2
<!-- Please only use this template for submitting clean up requests -->

**What would you like to be cleaned**:

We would like to upgrade the golangci-lint major version from v1 to v2.

**Why is this needed**:

Currently, we are using v1 last release: https://github.com/kubernetes-sigs/kueue/blob/e3ba696faab9c75d8e9268395efd9ca2ddf598c1/hack/internal/tools/go.mod#L7


Hints from issue comments:
@mbobrovskyi: /assign

Solution patch:
diff --git a/.golangci.yaml b/.golangci.yaml
index 6d729f2ea..d8f5480f2 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -1,77 +1,18 @@
 # golangci-lint configuration file
 # see: https://golangci-lint.run/usage/configuration/
 
-# Settings of specific linters
-linters-settings:
-  gocritic:
-    enabled-checks:
-      - dupImport
-      - stringsCompare
-    disabled-checks:
-      - appendAssign
-      - exitAfterDefer
-  goheader:
-    template: |-
-      Copyright The Kubernetes Authors.
-
-      Licensed under the Apache License, Version 2.0 (the "License");
-      you may not use this file except in compliance with the License.
-      You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-      Unless required by applicable law or agreed to in writing, software
-      distributed under the License is distributed on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-      See the License for the specific language governing permissions and
-      limitations under the License.
-    # We can't use the template-path option because it requires text without `/*` and `*/` comments.
-    # We can't remove the comments `/*` and `*/` because the controller-gen requires them.
-    # template-path: ./hack/boilerplate.go.txt
-  govet:
-    enable:
-      - nilness
-  gci:
-    sections:
-      - standard # Standard section: captures all standard packages.
-      - default # Default section: contains all imports that could not be matched to another section type.
-      - prefix(sigs.k8s.io/kueue) # Custom section: groups all imports with the specified Prefix.
-      - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
-      - dot # Dot section: contains all dot imports.
-    skip-generated: true # Skip generated files.
-  nolintlint:
-    # Require nolint directives to mention the specific linter being suppressed.
-    require-specific: true
-    # Require an explanation after each nolint directive.
-    require-explanation: true
-  perfsprint:
-    int-conversion: false
-    errorf: true
-    sprintf1: false
-    strconcat: false
-  revive:
-    enable-all-rules: false
-    rules:
-      - name: context-as-argument
-      - name: empty-lines
-      - name: increment-decrement
-      - name: var-naming
-      - name: redundant-import-alias
-      - name: use-any
-
-# Settings for enabling and disabling linters
+version: "2"
 linters:
   enable:
     - copyloopvar
     - dupword
     - durationcheck
     - fatcontext
-    - gci
     - ginkgolinter
     - gocritic
     - goheader
-    - govet
     - loggercheck
+    - makezero
     - misspell
     - nilerr
     - nilnesserr
@@ -79,30 +20,102 @@ linters:
     - perfsprint
     - revive
     - unconvert
-    - makezero
+  settings:
+    gocritic:
+      enabled-checks:
+        - dupImport
+        - stringsCompare
+      disabled-checks:
+        - appendAssign
+        - exitAfterDefer
+    goheader:
+      template: |-
+        Copyright The Kubernetes Authors.
+
+        Licensed under the Apache License, Version 2.0 (the "License");
+        you may not use this file except in compliance with the License.
+        You may obtain a copy of the License at
+
+            http://www.apache.org/licenses/LICENSE-2.0
 
-# Settings related to issues
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+      # We can't use the template-path option because it requires text without `/*` and `*/` comments.
+      # We can't remove the comments `/*` and `*/` because the controller-gen requires them.
+      # template-path: ./hack/boilerplate.go.txt
+    govet:
+      enable:
+        - nilness
+    nolintlint:
+      # Require an explanation after each nolint directive.
+      require-explanation: true
+      # Require nolint directives to mention the specific linter being suppressed.
+      require-specific: true
+    perfsprint:
+      int-conversion: false
+      errorf: true
+      sprintf1: false
+      strconcat: false
+    revive:
+      enable-all-rules: false
+      rules:
+        - name: context-as-argument
+        - name: empty-lines
+        - name: increment-decrement
+        - name: var-naming
+        - name: redundant-import-alias
+        - name: use-any
+  exclusions:
+    generated: lax
+    presets:
+      - comments
+      - common-false-positives
+      - legacy
+      - std-error-handling
+    rules:
+      - linters:
+          - staticcheck
+        # TODO(#768): Drop when incrementing the API version.
+        text: 'SA1019: constants.QueueAnnotation is deprecated'
+      - linters:
+          - staticcheck
+        text: 'SA1019: j.Status.State is deprecated: the State field is replaced by the Conditions field.'
+      - linters:
+          - staticcheck
+        text: 'SA1019: j.Status.RayClusterStatus.State is deprecated: the State field is replaced by the Conditions field.'
+      - linters:
+          - fatcontext
+        path: ^test/*
+    paths:
+      - bin
+      - vendor
+      - third_party$
+      - builtin$
+      - examples$
 issues:
-  # Which dirs to exclude: issues from them won't be reported
-  exclude-dirs:
-    - bin
-    - vendor
-  # Excluding configuration per-path, per-linter, per-text and per-source
-  exclude-rules:
-    - linters:
-      - staticcheck
-      # TODO(#768): Drop when incrementing the API version.
-      text: "SA1019: constants.QueueAnnotation is deprecated"
-    - linters:
-        - staticcheck
-      text: "SA1019: j.Status.State is deprecated: the State field is replaced by the Conditions field."
-    - linters:
-        - staticcheck
-      text: "SA1019: j.Status.RayClusterStatus.State is deprecated: the State field is replaced by the Conditions field."
-    - linters:
-        - fatcontext
-      path: "^test/*"
   # Show all issues from a linter
   max-issues-per-linter: 0
   # Show all issues with the same text
   max-same-issues: 0
+formatters:
+  enable:
+    - gci
+  settings:
+    gci:
+      sections:
+        - standard # Standard section: captures all standard packages.
+        - default # Default section: contains all imports that could not be matched to another section type.
+        - prefix(sigs.k8s.io/kueue) # Custom section: groups all imports with the specified Prefix.
+        - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
+        - dot # Dot section: contains all dot imports.
+  exclusions:
+    generated: lax
+    paths:
+      - bin
+      - vendor
+      - third_party$
+      - builtin$
+      - examples$
diff --git a/Makefile-deps.mk b/Makefile-deps.mk
index da5454fc8..73ced56eb 100644
--- a/Makefile-deps.mk
+++ b/Makefile-deps.mk
@@ -26,7 +26,7 @@ GO_CMD ?= go
 
 # Use go.mod go version as source.
 GINKGO_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' github.com/onsi/ginkgo/v2)
-GOLANGCI_LINT_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' github.com/golangci/golangci-lint)
+GOLANGCI_LINT_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)
 CONTROLLER_GEN_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' sigs.k8s.io/controller-tools)
 KUSTOMIZE_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' sigs.k8s.io/kustomize/kustomize/v5)
 ENVTEST_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' sigs.k8s.io/controller-runtime/tools/setup-envtest)
@@ -42,7 +42,7 @@ MDTOC_VERSION ?= $(shell cd $(TOOLS_DIR); $(GO_CMD) list -m -f '{{.Version}}' si
 GOLANGCI_LINT = $(PROJECT_DIR)/bin/golangci-lint
 .PHONY: golangci-lint
 golangci-lint: ## Download golangci-lint locally if necessary.
-	@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
+	@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
 
 CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
 .PHONY: controller-gen
diff --git a/charts/kueue/templates/rbac/topology_editor_role.yaml b/charts/kueue/templates/rbac/topology_editor_role.yaml
index a24c6343f..29e7ad076 100644
--- a/charts/kueue/templates/rbac/topology_editor_role.yaml
+++ b/charts/kueue/templates/rbac/topology_editor_role.yaml
@@ -10,7 +10,7 @@ rules:
   - apiGroups:
       - kueue.x-k8s.io
     resources:
-      - topology
+      - topologies
     verbs:
       - create
       - delete
diff --git a/charts/kueue/templates/rbac/topology_viewer_role.yaml b/charts/kueue/templates/rbac/topology_viewer_role.yaml
index 818660e76..2a2dca7eb 100644
--- a/charts/kueue/templates/rbac/topology_viewer_role.yaml
+++ b/charts/kueue/templates/rbac/topology_viewer_role.yaml
@@ -9,7 +9,7 @@ rules:
   - apiGroups:
       - kueue.x-k8s.io
     resources:
-      - topology
+      - topologies
     verbs:
       - get
       - list
diff --git a/cmd/kueuectl/app/list/helpers.go b/cmd/kueuectl/app/list/helpers.go
index 351d70e4b..e09f4db22 100644
--- a/cmd/kueuectl/app/list/helpers.go
+++ b/cmd/kueuectl/app/list/helpers.go
@@ -33,7 +33,7 @@ const (
 )
 
 var (
-	invalidListRequestLimitError = errors.New("invalid list request limit")
+	errInvalidListRequestLimit = errors.New("invalid list request limit")
 )
 
 func listRequestLimit() (int64, error) {
@@ -45,7 +45,7 @@ func listRequestLimit() (int64, error) {
 
 	limit, err := strconv.ParseInt(listRequestLimitEnv, 10, 64)
 	if err != nil {
-		return 0, invalidListRequestLimitError
+		return 0, errInvalidListRequestLimit
 	}
 
 	return limit, nil
diff --git a/cmd/kueuectl/app/list/list_pods.go b/cmd/kueuectl/app/list/list_pods.go
index 095fd3550..14da58ca6 100644
--- a/cmd/kueuectl/app/list/list_pods.go
+++ b/cmd/kueuectl/app/list/list_pods.go
@@ -202,7 +202,7 @@ func (o *PodOptions) getForObjectInfos(clientGetter util.ClientGetter) ([]*resou
 		Do()
 
 	if r == nil {
-		return nil, fmt.Errorf("Error building client for: %s/%s", o.ForGVK.Kind, o.ForName)
+		return nil, fmt.Errorf("building client for: %s", o.UserSpecifiedForObject)
 	}
 
 	if err := r.Err(); err != nil {
@@ -220,7 +220,7 @@ func (o *PodOptions) getForObjectInfos(clientGetter util.ClientGetter) ([]*resou
 func (o *PodOptions) getForObject(infos []*resource.Info) (*unstructured.Unstructured, error) {
 	job, ok := infos[0].Object.(*unstructured.Unstructured)
 	if !ok {
-		return nil, fmt.Errorf("Invalid object %+v. Unexpected type %T", job, infos[0].Object)
+		return nil, fmt.Errorf("unexpected type %T", infos[0].Object)
 	}
 
 	return job, nil
diff --git a/cmd/kueuectl/app/list/list_workload.go b/cmd/kueuectl/app/list/list_workload.go
index d3a6dba5f..a7a1102a1 100644
--- a/cmd/kueuectl/app/list/list_workload.go
+++ b/cmd/kueuectl/app/list/list_workload.go
@@ -151,7 +151,7 @@ func getWorkloadStatuses(cmd *cobra.Command) (sets.Set[int], error) {
 		case "finished":
 			statuses.Insert(workloadStatusFinished)
 		default:
-			return nil, fmt.Errorf(`Invalid status value (%v). Must be "all", "pending", "admitted" or "finished".`, status)
+			return nil, fmt.Errorf(`invalid status value (%v). Must be "all", "pending", "admitted" or "finished"`, status)
 		}
 	}
 
@@ -477,7 +477,7 @@ func (o *WorkloadOptions) pendingWorkloads(ctx context.Context, list *v1beta1.Wo
 func (o *WorkloadOptions) apiResources(list *v1beta1.WorkloadList) (map[string]*metav1.APIResourceList, error) {
 	apiResourceLists := make(map[string]*metav1.APIResourceList)
 	for _, wl := range list.Items {
-		for _, ref := range wl.ObjectMeta.OwnerReferences {
+		for _, ref := range wl.OwnerReferences {
 			if _, ok := apiResourceLists[ref.APIVersion]; !ok {
 				rl, err := o.ClientSet.Discovery().ServerResourcesForGroupVersion(ref.APIVersion)
 				if client.IgnoreNotFound(err) != nil {
diff --git a/cmd/kueuectl/app/list/list_workload_printer.go b/cmd/kueuectl/app/list/list_workload_printer.go
index 29697495a..ecd296732 100644
--- a/cmd/kueuectl/app/list/list_workload_printer.go
+++ b/cmd/kueuectl/app/list/list_workload_printer.go
@@ -171,7 +171,7 @@ func (p *listWorkloadPrinter) printWorkload(wl *v1beta1.Workload) metav1.TableRo
 func (p *listWorkloadPrinter) crdTypes(wl *v1beta1.Workload) []string {
 	crdTypes := sets.New[string]()
 
-	for _, ref := range wl.ObjectMeta.OwnerReferences {
+	for _, ref := range wl.OwnerReferences {
 		var apiResource *metav1.APIResource
 
 		if resourceList := p.resources.apiResourceLists[ref.APIVersion]; resourceList != nil {
@@ -194,7 +194,7 @@ func (p *listWorkloadPrinter) crdTypes(wl *v1beta1.Workload) []string {
 func (p *listWorkloadPrinter) crdNames(wl *v1beta1.Workload) []string {
 	crdNames := sets.New[string]()
 
-	for _, ref := range wl.ObjectMeta.OwnerReferences {
+	for _, ref := range wl.OwnerReferences {
 		crdNames.Insert(ref.Name)
 	}
 
diff --git a/cmd/kueuectl/app/util/dry_run.go b/cmd/kueuectl/app/util/dry_run.go
index 9afef2368..f2ad2c9cf 100644
--- a/cmd/kueuectl/app/util/dry_run.go
+++ b/cmd/kueuectl/app/util/dry_run.go
@@ -68,7 +68,7 @@ func GetDryRunStrategy(cmd *cobra.Command) (DryRunStrategy, error) {
 	case "none":
 		return DryRunNone, nil
 	default:
-		return DryRunNone, fmt.Errorf(`Invalid dry-run value (%v). Must be "none", "server", or "client".`, dryRunFlag)
+		return DryRunNone, fmt.Errorf(`invalid dry-run value (%v). Must be "none", "server", or "client"`, dryRunFlag)
 	}
 }
 
diff --git a/config/components/rbac/topology_editor_role.yaml b/config/components/rbac/topology_editor_role.yaml
index 7315e5a2a..5a90ce1e3 100644
--- a/config/components/rbac/topology_editor_role.yaml
+++ b/config/components/rbac/topology_editor_role.yaml
@@ -9,7 +9,7 @@ rules:
 - apiGroups:
   - kueue.x-k8s.io
   resources:
-  - topology
+  - topologies
   verbs:
   - create
   - delete
diff --git a/config/components/rbac/topology_viewer_role.yaml b/config/components/rbac/topology_viewer_role.yaml
index 50d2a72fd..d5726975c 100644
--- a/config/components/rbac/topology_viewer_role.yaml
+++ b/config/components/rbac/topology_viewer_role.yaml
@@ -8,7 +8,7 @@ rules:
 - apiGroups:
   - kueue.x-k8s.io
   resources:
-  - topology
+  - topologies
   verbs:
   - get
   - list
diff --git a/hack/internal/tools/go.mod b/hack/internal/tools/go.mod
index 765a9222b..cf6493ec8 100644
--- a/hack/internal/tools/go.mod
+++ b/hack/internal/tools/go.mod
@@ -4,7 +4,7 @@ go 1.24.0
 
 require (
 	github.com/gohugoio/hugo v0.146.7
-	github.com/golangci/golangci-lint v1.64.8
+	github.com/golangci/golangci-lint/v2 v2.1.5
 	github.com/mikefarah/yq/v4 v4.45.1
 	github.com/onsi/ginkgo/v2 v2.23.4
 	gopkg.in/yaml.v3 v3.0.1
@@ -21,10 +21,10 @@ require (
 require (
 	dario.cat/mergo v1.0.1 // indirect
 	github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
-	github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
+	github.com/BurntSushi/toml v1.5.0 // indirect
 	github.com/MakeNowJust/heredoc v1.0.0 // indirect
 	github.com/Masterminds/goutils v1.1.1 // indirect
-	github.com/Masterminds/semver/v3 v3.3.0 // indirect
+	github.com/Masterminds/semver/v3 v3.3.1 // indirect
 	github.com/Masterminds/sprig/v3 v3.3.0 // indirect
 	github.com/a8m/envsubst v1.4.2 // indirect
 	github.com/alecthomas/assert/v2 v2.11.0 // indirect
@@ -113,7 +113,7 @@ require (
 	golang.org/x/text v0.24.0 // indirect
 	golang.org/x/time v0.10.0 // indirect
 	golang.org/x/tools v0.32.0 // indirect
-	google.golang.org/protobuf v1.36.5 // indirect
+	google.golang.org/protobuf v1.36.6 // indirect
 	gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
diff --git a/hack/internal/tools/go.sum b/hack/internal/tools/go.sum
index 3a4cc62f4..f6f805f72 100644
--- a/hack/internal/tools/go.sum
+++ b/hack/internal/tools/go.sum
@@ -4,14 +4,14 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
-github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
+github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
 github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
 github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
 github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
 github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
-github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
-github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
+github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
+github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
 github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs=
 github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
 github.com/a8m/envsubst v1.4.2 h1:4yWIHXOLEJHQEFd4UjrWDrYeYlV7ncFWJOCBRLOZHQg=
@@ -97,8 +97,8 @@ github.com/gohugoio/hugo v0.146.7 h1:HZ2BVvXX4DsAqBvPXe31HhOGMppIcE+ur2HD6mGr/k0
 github.com/gohugoio/hugo v0.146.7/go.mod h1:EoUvqV0cPxt+ghvJylO9cnsxKNfUGFYSi8ui1/wuS1I=
 github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
 github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/golangci/golangci-lint v1.64.8 h1:y5TdeVidMtBGG32zgSC7ZXTFNHrsJkDnpO4ItB3Am+I=
-github.com/golangci/golangci-lint v1.64.8/go.mod h1:5cEsUQBSr6zi8XI8OjmcY2Xmliqc4iYL7YoPrL+zLJ4=
+github.com/golangci/golangci-lint/v2 v2.1.5 h1:zDcxV8s7kgQW3cpQiVA633CZJnKN/0iEXibPDWO8sZo=
+github.com/golangci/golangci-lint/v2 v2.1.5/go.mod h1:RGcjZLyl9fSVLqxdKMrknPlspC3TYETLoKXyRG06RDo=
 github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0 h1:4gjrh/PN2MuWCCElk8/I4OCKRKWCCo2zEct3VKCbibU=
 github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
 github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
@@ -299,8 +299,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
-google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
+google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
+google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
diff --git a/hack/internal/tools/pinversion.go b/hack/internal/tools/pinversion.go
index 0144c2815..ea459abc9 100644
--- a/hack/internal/tools/pinversion.go
+++ b/hack/internal/tools/pinversion.go
@@ -24,7 +24,7 @@ import (
 	// we need to reference individual dependencies used by it
 	_ "github.com/gohugoio/hugo/common"
 	_ "github.com/gohugoio/hugo/docshelper"
-	_ "github.com/golangci/golangci-lint/pkg/exitcodes"
+	_ "github.com/golangci/golangci-lint/v2/pkg/exitcodes"
 	_ "github.com/mikefarah/yq/v4/cmd"
 	_ "github.com/onsi/ginkgo/v2/ginkgo/command"
 	_ "github.com/onsi/ginkgo/v2/ginkgo/run"
diff --git a/pkg/cache/tas_flavor_snapshot.go b/pkg/cache/tas_flavor_snapshot.go
index 4fbde49c7..69f724624 100644
--- a/pkg/cache/tas_flavor_snapshot.go
+++ b/pkg/cache/tas_flavor_snapshot.go
@@ -701,7 +701,7 @@ func (s *TASFlavorSnapshot) fillInCounts(requests resources.Requests,
 		if !simulateEmpty {
 			remainingCapacity.Sub(leaf.tasUsage)
 		}
-		if leafAssumedUsage, found := assumedUsage[leaf.domain.id]; found {
+		if leafAssumedUsage, found := assumedUsage[leaf.id]; found {
 			remainingCapacity.Sub(leafAssumedUsage)
 		}
 		leaf.state = requests.CountIn(remainingCapacity)
diff --git a/pkg/config/validation.go b/pkg/config/validation.go
index 1600f5a88..b4f0fab4e 100644
--- a/pkg/config/validation.go
+++ b/pkg/config/validation.go
@@ -310,7 +310,7 @@ func validateResourceTransformations(c *configapi.Configuration) field.ErrorList
 	seenKeys := make(sets.Set[corev1.ResourceName])
 	for idx, transform := range res.Transformations {
 		strategy := ptr.Deref(transform.Strategy, "")
-		if !(strategy == configapi.Retain || strategy == configapi.Replace) {
+		if strategy != configapi.Retain && strategy != configapi.Replace {
 			allErrs = append(allErrs, field.NotSupported(resourceTransformationPath.Index(idx).Child("strategy"),
 				transform.Strategy, []configapi.ResourceTransformationStrategy{configapi.Retain, configapi.Replace}))
 		}
@@ -371,10 +371,10 @@ func ValidateFeatureGates(featureGateCLI string, featureGateMap map[string]bool)
 		}
 	}
 	if enabledProfilesCount > 1 {
-		return errors.New("Cannot use more than one TAS profiles")
+		return errors.New("cannot use more than one TAS profiles")
 	}
 	if !features.Enabled(features.TopologyAwareScheduling) && enabledProfilesCount > 0 {
-		return errors.New("Cannot use a TAS profile with TAS disabled")
+		return errors.New("cannot use a TAS profile with TAS disabled")
 	}
 
 	return nil
diff --git a/pkg/controller/core/clusterqueue_controller.go b/pkg/controller/core/clusterqueue_controller.go
index e49f96650..93fd5cca9 100644
--- a/pkg/controller/core/clusterqueue_controller.go
+++ b/pkg/controller/core/clusterqueue_controller.go
@@ -177,7 +177,7 @@ func (r *ClusterQueueReconciler) Reconcile(ctx context.Context, req ctrl.Request
 	log := ctrl.LoggerFrom(ctx)
 	log.V(2).Info("Reconcile ClusterQueue")
 
-	if cqObj.ObjectMeta.DeletionTimestamp.IsZero() {
+	if cqObj.DeletionTimestamp.IsZero() {
 		// Although we'll add the finalizer via webhook mutation now, this is still useful
 		// as a fallback.
 		if !controllerutil.ContainsFinalizer(&cqObj, kueue.ResourceInUseFinalizerName) {
diff --git a/pkg/controller/core/cohort_controller.go b/pkg/controller/core/cohort_controller.go
index 8c67df47c..a2dd20578 100644
--- a/pkg/controller/core/cohort_controller.go
+++ b/pkg/controller/core/cohort_controller.go
@@ -137,8 +137,8 @@ func (r *CohortReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
 	if err := r.client.Get(ctx, req.NamespacedName, &cohort); err != nil {
 		if apierrors.IsNotFound(err) {
 			log.V(2).Info("Cohort is being deleted")
-			r.cache.DeleteCohort(v1beta1.CohortReference(req.NamespacedName.Name))
-			r.qManager.DeleteCohort(v1beta1.CohortReference(req.NamespacedName.Name))
+			r.cache.DeleteCohort(v1beta1.CohortReference(req.Name))
+			r.qManager.DeleteCohort(v1beta1.CohortReference(req.Name))
 		}
 		return ctrl.Result{}, client.IgnoreNotFound(err)
 	}
diff --git a/pkg/controller/core/workload_controller.go b/pkg/controller/core/workload_controller.go
index b7f59f9d5..1303a4125 100644
--- a/pkg/controller/core/workload_controller.go
+++ b/pkg/controller/core/workload_controller.go
@@ -150,7 +150,7 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
 	log := ctrl.LoggerFrom(ctx)
 	log.V(2).Info("Reconcile Workload")
 
-	if len(wl.ObjectMeta.OwnerReferences) == 0 && !wl.DeletionTimestamp.IsZero() {
+	if len(wl.OwnerReferences) == 0 && !wl.DeletionTimestamp.IsZero() {
 		return ctrl.Result{}, workload.RemoveFinalizer(ctx, r.client, &wl)
 	}
 
@@ -174,7 +174,7 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
 			case kueue.WorkloadEvictedByPodsReadyTimeout, kueue.WorkloadEvictedByAdmissionCheck:
 				var requeueAfter time.Duration
 				if wl.Status.RequeueState != nil && wl.Status.RequeueState.RequeueAt != nil {
-					requeueAfter = wl.Status.RequeueState.RequeueAt.Time.Sub(r.clock.Now())
+					requeueAfter = wl.Status.RequeueState.RequeueAt.Sub(r.clock.Now())
 				}
 				if requeueAfter > 0 {
 					return reconcile.Result{RequeueAfter: requeueAfter}, nil
@@ -562,7 +562,7 @@ func (r *WorkloadReconciler) reconcileNotReadyTimeout(ctx context.Context, req c
 	if deactivated, err := r.triggerDeactivationOrBackoffRequeue(ctx, wl); deactivated || err != nil {
 		return 0, client.IgnoreNotFound(err)
 	}
-	message := fmt.Sprintf("Exceeded the PodsReady timeout %s", req.NamespacedName.String())
+	message := fmt.Sprintf("Exceeded the PodsReady timeout %s", req.String())
 	workload.SetEvictedCondition(wl, kueue.WorkloadEvictedByPodsReadyTimeout, message)
 	workload.ResetChecksOnEviction(wl, r.clock.Now())
 	err := workload.ApplyAdmissionStatus(ctx, r.client, wl, true, r.clock)
diff --git a/pkg/controller/jobs/job/job_controller.go b/pkg/controller/jobs/job/job_controller.go
index 2ed476f51..dfb3ff400 100644
--- a/pkg/controller/jobs/job/job_controller.go
+++ b/pkg/controller/jobs/job/job_controller.go
@@ -169,11 +169,11 @@ func (j *Job) Stop(ctx context.Context, c client.Client, podSetsInfo []podset.Po
 	if !j.IsSuspended() {
 		if err := clientutil.Patch(ctx, c, object, true, func() (bool, error) {
 			j.Suspend()
-			if j.ObjectMeta.Annotations == nil {
-				j.ObjectMeta.Annotations = map[string]string{}
+			if j.Annotations == nil {
+				j.Annotations = map[string]string{}
 			}
 			// We are using annotation to be sure that all updates finished successfully.
-			j.ObjectMeta.Annotations[StoppingAnnotation] = "true"
+			j.Annotations[StoppingAnnotation] = "true"
 			return true, nil
 		}); err != nil {
 			return false, fmt.Errorf("suspend: %w", err)
@@ -193,7 +193,7 @@ func (j *Job) Stop(ctx context.Context, c client.Client, podSetsInfo []podset.Po
 
 	if err := clientutil.Patch(ctx, c, object, true, func() (bool, error) {
 		j.RestorePodSetsInfo(podSetsInfo)
-		delete(j.ObjectMeta.Annotations, StoppingAnnotation)
+		delete(j.Annotations, StoppingAnnotation)
 		return true, nil
 	}); err != nil {
 		return false, fmt.Errorf("restore info: %w", err)
diff --git a/pkg/controller/jobs/pod/event_handlers.go b/pkg/controller/jobs/pod/event_handlers.go
index 8a47652a6..629375a01 100644
--- a/pkg/controller/jobs/pod/event_handlers.go
+++ b/pkg/controller/jobs/pod/event_handlers.go
@@ -139,7 +139,7 @@ func (h *workloadHandler) queueReconcileForChildPod(ctx context.Context, object
 	}
 	log := ctrl.LoggerFrom(ctx).WithValues("workload", klog.KObj(w))
 
-	if len(w.ObjectMeta.OwnerReferences) == 0 {
+	if len(w.OwnerReferences) == 0 {
 		return
 	}
 	log.V(5).Info("Queueing reconcile for parent pods")
diff --git a/pkg/controller/jobs/rayjob/rayjob_controller.go b/pkg/controller/jobs/rayjob/rayjob_controller.go
index eec0bfef7..00951d6c4 100644
--- a/pkg/controller/jobs/rayjob/rayjob_controller.go
+++ b/pkg/controller/jobs/rayjob/rayjob_controller.go
@@ -93,7 +93,7 @@ func (j *RayJob) IsSuspended() bool {
 
 func (j *RayJob) IsActive() bool {
 	// When the status is Suspended or New there should be no running Pods, and so the Job is not active.
-	return !(j.Status.JobDeploymentStatus == rayv1.JobDeploymentStatusSuspended || j.Status.JobDeploymentStatus == rayv1.JobDeploymentStatusNew)
+	return j.Status.JobDeploymentStatus != rayv1.JobDeploymentStatusSuspended && j.Status.JobDeploymentStatus != rayv1.JobDeploymentStatusNew
 }
 
 func (j *RayJob) Suspend() {
diff --git a/pkg/controller/tas/resource_flavor.go b/pkg/controller/tas/resource_flavor.go
index 884023794..feba624e6 100644
--- a/pkg/controller/tas/resource_flavor.go
+++ b/pkg/controller/tas/resource_flavor.go
@@ -144,7 +144,7 @@ func (r *rfReconciler) Reconcile(ctx context.Context, req reconcile.Request) (re
 		if client.IgnoreNotFound(err) != nil {
 			return reconcile.Result{}, err
 		}
-		r.tasCache.Delete(kueue.ResourceFlavorReference(req.NamespacedName.Name))
+		r.tasCache.Delete(kueue.ResourceFlavorReference(req.Name))
 	}
 	if flv.Spec.TopologyName != nil {
 		flavorReference := kueue.ResourceFlavorReference(flv.Name)
diff --git a/pkg/scheduler/preemption/classical/hierarchical_preemption.go b/pkg/scheduler/preemption/classical/hierarchical_preemption.go
index 80d0aa17f..ca3159146 100644
--- a/pkg/scheduler/preemption/classical/hierarchical_preemption.go
+++ b/pkg/scheduler/preemption/classical/hierarchical_preemption.go
@@ -219,7 +219,7 @@ func getNodeHeight(node *cache.CohortSnapshot) int {
 // height the whole cohort hierarchy. Note that height of a trivial subtree
 // with only one node is 0. It also returns if the returned subtree is smaller than the whole cohort tree.
 func FindHeightOfLowestSubtreeThatFits(c *cache.ClusterQueueSnapshot, fr resources.FlavorResource, val int64) (int, bool) {
-	if !(c.BorrowingWith(fr, val) && c.HasParent()) {
+	if !c.BorrowingWith(fr, val) || !c.HasParent() {
 		return 0, c.HasParent()
 	}
 	remaining := val - cache.LocalAvailable(c, fr)
diff --git a/pkg/scheduler/preemption/preemption.go b/pkg/scheduler/preemption/preemption.go
index a089a0e65..d67ea31ed 100644
--- a/pkg/scheduler/preemption/preemption.go
+++ b/pkg/scheduler/preemption/preemption.go
@@ -427,7 +427,7 @@ func (p *Preemptor) findCandidates(wl *kueue.Workload, cq *cache.ClusterQueueSna
 				continue
 			}
 
-			if candidatePriority == wlPriority && !(considerSamePrio && preemptorTS.Before(p.workloadOrdering.GetQueueOrderTimestamp(candidateWl.Obj))) {
+			if candidatePriority == wlPriority && (!considerSamePrio || !preemptorTS.Before(p.workloadOrdering.GetQueueOrderTimestamp(candidateWl.Obj))) {
 				continue
 			}
 
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index 05fda284a..1f5a96eba 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -370,7 +370,7 @@ func (s *Scheduler) nominate(ctx context.Context, workloads []workload.Info, sna
 		} else {
 			e.assignment, e.preemptionTargets = s.getAssignments(log, &e.Info, snap)
 			e.inadmissibleMsg = e.assignment.Message()
-			e.Info.LastAssignment = &e.assignment.LastState
+			e.LastAssignment = &e.assignment.LastState
 		}
 		entries = append(entries, e)
 	}
diff --git a/pkg/visibility/server.go b/pkg/visibility/server.go
index c086ea87b..b6a8623b6 100644
--- a/pkg/visibility/server.go
+++ b/pkg/visibility/server.go
@@ -101,13 +101,13 @@ func newVisibilityServerConfig() *genericapiserver.RecommendedConfig {
 	versionInfo := version.Get()
 	version := strings.Split(versionInfo.String(), "-")[0]
 	// enable OpenAPI schemas
-	c.Config.EffectiveVersion = utilversion.NewEffectiveVersion(version)
-	c.Config.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
-	c.Config.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
-	c.Config.OpenAPIConfig.Info.Title = "Kueue visibility-server"
-	c.Config.OpenAPIV3Config.Info.Title = "Kueue visibility-server"
-	c.Config.OpenAPIConfig.Info.Version = version
-	c.Config.OpenAPIV3Config.Info.Version = version
+	c.EffectiveVersion = utilversion.NewEffectiveVersion(version)
+	c.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
+	c.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
+	c.OpenAPIConfig.Info.Title = "Kueue visibility-server"
+	c.OpenAPIV3Config.Info.Title = "Kueue visibility-server"
+	c.OpenAPIConfig.Info.Version = version
+	c.OpenAPIV3Config.Info.Version = version
 
 	c.EnableMetrics = true
 



Test patch:
diff --git a/cmd/kueuectl/app/create/create_resourceflavor_test.go b/cmd/kueuectl/app/create/create_resourceflavor_test.go
index 88743a47b..6dc1a3af5 100644
--- a/cmd/kueuectl/app/create/create_resourceflavor_test.go
+++ b/cmd/kueuectl/app/create/create_resourceflavor_test.go
@@ -244,7 +244,7 @@ func TestResourceFlavorCmd(t *testing.T) {
 		"shouldn't create resource flavor with invalid dry-run client": {
 			rfName:  "rf",
 			args:    []string{"--dry-run", "invalid"},
-			wantErr: "Invalid dry-run value (invalid). Must be \"none\", \"server\", or \"client\".",
+			wantErr: "invalid dry-run value (invalid). Must be \"none\", \"server\", or \"client\"",
 		},
 		"shouldn't create resource flavor with dry-run client": {
 			rfName:  "rf",
diff --git a/pkg/util/testing/client.go b/pkg/util/testing/client.go
index 43986563f..32d7123bb 100644
--- a/pkg/util/testing/client.go
+++ b/pkg/util/testing/client.go
@@ -64,7 +64,7 @@ type builderIndexer struct {
 }
 
 func (b *builderIndexer) IndexField(_ context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error {
-	b.ClientBuilder = b.ClientBuilder.WithIndex(obj, field, extractValue)
+	b.ClientBuilder = b.WithIndex(obj, field, extractValue)
 	return nil
 }
 
diff --git a/pkg/util/testing/error_matchers.go b/pkg/util/testing/error_matchers.go
index aa3492dcd..7936fcfec 100644
--- a/pkg/util/testing/error_matchers.go
+++ b/pkg/util/testing/error_matchers.go
@@ -67,6 +67,7 @@ func BeError(errorType ErrorType) types.GomegaMatcher {
 func (matcher *errorMatcher) Match(actual any) (success bool, err error) {
 	err, ok := actual.(error)
 	if !ok {
+		//nolint:staticcheck // We keep the error capitalized for consistency with built-in matchers.
 		return false, fmt.Errorf("Error matcher expects an error.  Got:\n%s", format.Object(actual, 1))
 	}
 
diff --git a/pkg/util/testing/metrics_matchers.go b/pkg/util/testing/metrics_matchers.go
index 8f99294bf..b9ce45573 100644
--- a/pkg/util/testing/metrics_matchers.go
+++ b/pkg/util/testing/metrics_matchers.go
@@ -66,6 +66,7 @@ func containsMetric(output []string, metric []string) bool {
 func (matcher *metricsMatcher) Match(actual any) (bool, error) {
 	input, ok := actual.(string)
 	if !ok {
+		//nolint:staticcheck // We keep the error capitalized for consistency with built-in matchers.
 		return false, fmt.Errorf("Metrics matcher expects a string. Got:\n%s", format.Object(actual, 1))
 	}
 
diff --git a/pkg/util/testing/wrappers.go b/pkg/util/testing/wrappers.go
index 721d98822..f3d99f07d 100644
--- a/pkg/util/testing/wrappers.go
+++ b/pkg/util/testing/wrappers.go
@@ -692,7 +692,7 @@ func (q *LocalQueueWrapper) Generation(num int64) *LocalQueueWrapper {
 // GeneratedName sets the prefix for the server to generate unique name.
 // No name should be given in the MakeClusterQueue for the GeneratedName to work.
 func (q *LocalQueueWrapper) GeneratedName(name string) *LocalQueueWrapper {
-	q.ObjectMeta.GenerateName = name
+	q.GenerateName = name
 	return q
 }
 
@@ -713,7 +713,7 @@ func (c *CohortWrapper) Obj() *kueuealpha.Cohort {
 }
 
 func (c *CohortWrapper) Parent(parentName kueue.CohortReference) *CohortWrapper {
-	c.Cohort.Spec.Parent = parentName
+	c.Spec.Parent = parentName
 	return c
 }
 
@@ -774,7 +774,7 @@ func (c *ClusterQueueWrapper) AdmissionCheckStrategy(acs ...kueue.AdmissionCheck
 // GeneratedName sets the prefix for the server to generate unique name.
 // No name should be given in the MakeClusterQueue for the GeneratedName to work.
 func (c *ClusterQueueWrapper) GeneratedName(name string) *ClusterQueueWrapper {
-	c.ObjectMeta.GenerateName = name
+	c.GenerateName = name
 	return c
 }
 
@@ -992,16 +992,16 @@ func (rf *ResourceFlavorWrapper) Obj() *kueue.ResourceFlavor {
 
 // TopologyName sets the topology name
 func (rf *ResourceFlavorWrapper) TopologyName(name string) *ResourceFlavorWrapper {
-	rf.ResourceFlavor.Spec.TopologyName = ptr.To(kueue.TopologyReference(name))
+	rf.Spec.TopologyName = ptr.To(kueue.TopologyReference(name))
 	return rf
 }
 
 // Label sets the label on the ResourceFlavor.
 func (rf *ResourceFlavorWrapper) Label(k, v string) *ResourceFlavorWrapper {
-	if rf.ObjectMeta.Labels == nil {
-		rf.ObjectMeta.Labels = map[string]string{}
+	if rf.Labels == nil {
+		rf.Labels = map[string]string{}
 	}
-	rf.ObjectMeta.Labels[k] = v
+	rf.Labels[k] = v
 	return rf
 }
 
@@ -1331,27 +1331,27 @@ func (c *ContainerWrapper) Name(name string) *ContainerWrapper {
 
 // WithResourceReq appends a resource request to the container.
 func (c *ContainerWrapper) WithResourceReq(resourceName corev1.ResourceName, quantity string) *ContainerWrapper {
-	requests := utilResource.MergeResourceListKeepFirst(c.Container.Resources.Requests, corev1.ResourceList{
+	requests := utilResource.MergeResourceListKeepFirst(c.Resources.Requests, corev1.ResourceList{
 		resourceName: resource.MustParse(quantity),
 	})
-	c.Container.Resources.Requests = requests
+	c.Resources.Requests = requests
 
 	return c
 }
 
 // WithResourceLimit appends a resource limit to the container.
 func (c *ContainerWrapper) WithResourceLimit(resourceName corev1.ResourceName, quantity string) *ContainerWrapper {
-	limits := utilResource.MergeResourceListKeepFirst(c.Container.Resources.Limits, corev1.ResourceList{
+	limits := utilResource.MergeResourceListKeepFirst(c.Resources.Limits, corev1.ResourceList{
 		resourceName: resource.MustParse(quantity),
 	})
-	c.Container.Resources.Limits = limits
+	c.Resources.Limits = limits
 
 	return c
 }
 
 // AsSidecar makes the container a sidecar when used as an Init Container.
 func (c *ContainerWrapper) AsSidecar() *ContainerWrapper {
-	c.Container.RestartPolicy = ptr.To(corev1.ContainerRestartPolicyAlways)
+	c.RestartPolicy = ptr.To(corev1.ContainerRestartPolicyAlways)
 
 	return c
 }
@@ -1470,10 +1470,10 @@ func (w *PodTemplateWrapper) Clone() *PodTemplateWrapper {
 }
 
 func (w *PodTemplateWrapper) Label(k, v string) *PodTemplateWrapper {
-	if w.ObjectMeta.Labels == nil {
-		w.ObjectMeta.Labels = make(map[string]string)
+	if w.Labels == nil {
+		w.Labels = make(map[string]string)
 	}
-	w.ObjectMeta.Labels[k] = v
+	w.Labels[k] = v
 	return w
 }
 
@@ -1528,10 +1528,10 @@ func (w *NamespaceWrapper) GenerateName(generateName string) *NamespaceWrapper {
 }
 
 func (w *NamespaceWrapper) Label(k, v string) *NamespaceWrapper {
-	if w.ObjectMeta.Labels == nil {
-		w.ObjectMeta.Labels = make(map[string]string)
+	if w.Labels == nil {
+		w.Labels = make(map[string]string)
 	}
-	w.ObjectMeta.Labels[k] = v
+	w.Labels[k] = v
 	return w
 }
 
diff --git a/pkg/util/testingjobs/appwrapper/wrappers.go b/pkg/util/testingjobs/appwrapper/wrappers.go
index a55297988..97da447d2 100644
--- a/pkg/util/testingjobs/appwrapper/wrappers.go
+++ b/pkg/util/testingjobs/appwrapper/wrappers.go
@@ -124,7 +124,7 @@ func (aw *AppWrapperWrapper) Component(component Component) *AppWrapperWrapper {
 				Raw: []byte(patchedData),
 			},
 		}
-		aw.AppWrapper.Spec.Components = append(aw.AppWrapper.Spec.Components, awc)
+		aw.Spec.Components = append(aw.Spec.Components, awc)
 	}
 	return aw
 }
@@ -143,12 +143,12 @@ func (aw *AppWrapperWrapper) SetCondition(condition metav1.Condition) *AppWrappe
 
 // SetPhase sets the status phase of the AppWrapeer.
 func (aw *AppWrapperWrapper) SetPhase(phase awv1beta2.AppWrapperPhase) *AppWrapperWrapper {
-	aw.AppWrapper.Status.Phase = phase
+	aw.Status.Phase = phase
 	return aw
 }
 
 // ManagedBy adds a managedby.
 func (aw *AppWrapperWrapper) ManagedBy(c string) *AppWrapperWrapper {
-	aw.AppWrapper.Spec.ManagedBy = &c
+	aw.Spec.ManagedBy = &c
 	return aw
 }
diff --git a/pkg/util/testingjobs/jobset/wrappers.go b/pkg/util/testingjobs/jobset/wrappers.go
index 4a167d911..22f61add1 100644
--- a/pkg/util/testingjobs/jobset/wrappers.go
+++ b/pkg/util/testingjobs/jobset/wrappers.go
@@ -70,7 +70,7 @@ func (j *JobSetWrapper) Obj() *jobsetapi.JobSet {
 
 // Clone returns a DeepCopy of j.
 func (j *JobSetWrapper) Clone() *JobSetWrapper {
-	return &JobSetWrapper{JobSet: *j.JobSet.DeepCopy()}
+	return &JobSetWrapper{JobSet: *j.DeepCopy()}
 }
 
 // ReplicatedJobs sets a new set of ReplicatedJobs in the inner JobSet.
diff --git a/pkg/util/testingjobs/mpijob/wrappers_mpijob.go b/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
index 567b1339a..d84395b68 100644
--- a/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
+++ b/pkg/util/testingjobs/mpijob/wrappers_mpijob.go
@@ -68,7 +68,7 @@ func (j *MPIJobWrapper) MPIJobReplicaSpecs(replicaSpecs ...MPIJobReplicaSpecRequ
 		j.Spec.MPIReplicaSpecs[rs.ReplicaType].Template.Spec.RestartPolicy = rs.RestartPolicy
 
 		if rs.Annotations != nil {
-			j.Spec.MPIReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+			j.Spec.MPIReplicaSpecs[rs.ReplicaType].Template.Annotations = rs.Annotations
 		}
 	}
 
diff --git a/pkg/util/testingjobs/paddlejob/wrappers.go b/pkg/util/testingjobs/paddlejob/wrappers.go
index 648f13ad9..b0005a8ed 100644
--- a/pkg/util/testingjobs/paddlejob/wrappers.go
+++ b/pkg/util/testingjobs/paddlejob/wrappers.go
@@ -64,7 +64,7 @@ func (j *PaddleJobWrapper) PaddleReplicaSpecs(replicaSpecs ...PaddleReplicaSpecR
 		j.Spec.PaddleReplicaSpecs[rs.ReplicaType].Template.Spec.Containers[0].Name = "paddle"
 
 		if rs.Annotations != nil {
-			j.Spec.PaddleReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+			j.Spec.PaddleReplicaSpecs[rs.ReplicaType].Template.Annotations = rs.Annotations
 		}
 	}
 
diff --git a/pkg/util/testingjobs/pod/wrappers.go b/pkg/util/testingjobs/pod/wrappers.go
index ee1d36d7f..3eab7fb51 100644
--- a/pkg/util/testingjobs/pod/wrappers.go
+++ b/pkg/util/testingjobs/pod/wrappers.go
@@ -189,7 +189,7 @@ func (p *PodWrapper) TopologySchedulingGate() *PodWrapper {
 // Gate adds kueue scheduling gate to the Pod by the gate name
 func (p *PodWrapper) Gate(gateNames ...string) *PodWrapper {
 	for _, gate := range gateNames {
-		p.Pod.Spec.SchedulingGates = append(p.Pod.Spec.SchedulingGates, corev1.PodSchedulingGate{
+		p.Spec.SchedulingGates = append(p.Spec.SchedulingGates, corev1.PodSchedulingGate{
 			Name: gate,
 		})
 	}
@@ -198,10 +198,10 @@ func (p *PodWrapper) Gate(gateNames ...string) *PodWrapper {
 
 // Finalizer adds a finalizer to the Pod
 func (p *PodWrapper) Finalizer(f string) *PodWrapper {
-	if p.ObjectMeta.Finalizers == nil {
-		p.ObjectMeta.Finalizers = make([]string, 0)
+	if p.Finalizers == nil {
+		p.Finalizers = make([]string, 0)
 	}
-	p.ObjectMeta.Finalizers = append(p.ObjectMeta.Finalizers, f)
+	p.Finalizers = append(p.Finalizers, f)
 	return p
 }
 
@@ -268,19 +268,19 @@ func (p *PodWrapper) UID(uid string) *PodWrapper {
 
 // StatusConditions updates status conditions of the Pod.
 func (p *PodWrapper) StatusConditions(conditions ...corev1.PodCondition) *PodWrapper {
-	p.Pod.Status.Conditions = conditions
+	p.Status.Conditions = conditions
 	return p
 }
 
 // StatusPhase updates status phase of the Pod.
 func (p *PodWrapper) StatusPhase(ph corev1.PodPhase) *PodWrapper {
-	p.Pod.Status.Phase = ph
+	p.Status.Phase = ph
 	return p
 }
 
 // StatusMessage updates status message of the Pod.
 func (p *PodWrapper) StatusMessage(msg string) *PodWrapper {
-	p.Pod.Status.Message = msg
+	p.Status.Message = msg
 	return p
 }
 
@@ -307,7 +307,7 @@ func (p *PodWrapper) Delete() *PodWrapper {
 
 // Volume adds a new volume for the pod object
 func (p *PodWrapper) Volume(v corev1.Volume) *PodWrapper {
-	p.Pod.Spec.Volumes = append(p.Pod.Spec.Volumes, v)
+	p.Spec.Volumes = append(p.Spec.Volumes, v)
 	return p
 }
 
diff --git a/pkg/util/testingjobs/pytorchjob/wrappers_pytorchjob.go b/pkg/util/testingjobs/pytorchjob/wrappers_pytorchjob.go
index 2ec073784..b5153c4a9 100644
--- a/pkg/util/testingjobs/pytorchjob/wrappers_pytorchjob.go
+++ b/pkg/util/testingjobs/pytorchjob/wrappers_pytorchjob.go
@@ -68,7 +68,7 @@ func (j *PyTorchJobWrapper) PyTorchReplicaSpecs(replicaSpecs ...PyTorchReplicaSp
 		j.Spec.PyTorchReplicaSpecs[rs.ReplicaType].Template.Spec.Containers[0].Args = rs.Args
 
 		if rs.Annotations != nil {
-			j.Spec.PyTorchReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+			j.Spec.PyTorchReplicaSpecs[rs.ReplicaType].Template.Annotations = rs.Annotations
 		}
 	}
 
diff --git a/pkg/util/testingjobs/raycluster/wrappers.go b/pkg/util/testingjobs/raycluster/wrappers.go
index 088f10263..25039bd12 100644
--- a/pkg/util/testingjobs/raycluster/wrappers.go
+++ b/pkg/util/testingjobs/raycluster/wrappers.go
@@ -202,9 +202,10 @@ func (j *ClusterWrapper) ManagedBy(c string) *ClusterWrapper {
 
 // Request adds a resource request to the default container.
 func (j *ClusterWrapper) Request(rayType rayv1.RayNodeType, r corev1.ResourceName, v string) *ClusterWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.HeadGroupSpec.Template.Spec.Containers[0].Resources.Requests[r] = resource.MustParse(v)
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Requests[r] = resource.MustParse(v)
 	}
 	return j
@@ -212,9 +213,10 @@ func (j *ClusterWrapper) Request(rayType rayv1.RayNodeType, r corev1.ResourceNam
 
 // Limit adds a resource limit to the default container.
 func (j *ClusterWrapper) Limit(rayType rayv1.RayNodeType, r corev1.ResourceName, v string) *ClusterWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.HeadGroupSpec.Template.Spec.Containers[0].Resources.Limits[r] = resource.MustParse(v)
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Limits[r] = resource.MustParse(v)
 	}
 	return j
@@ -226,10 +228,11 @@ func (j *ClusterWrapper) RequestAndLimit(rayType rayv1.RayNodeType, r corev1.Res
 }
 
 func (j *ClusterWrapper) Image(rayType rayv1.RayNodeType, image string, args []string) *ClusterWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.HeadGroupSpec.Template.Spec.Containers[0].Image = image
 		j.Spec.HeadGroupSpec.Template.Spec.Containers[0].Args = args
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Image = image
 		j.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Args = args
 	}
diff --git a/pkg/util/testingjobs/rayjob/wrappers.go b/pkg/util/testingjobs/rayjob/wrappers.go
index 479d1abbb..b6651e21c 100644
--- a/pkg/util/testingjobs/rayjob/wrappers.go
+++ b/pkg/util/testingjobs/rayjob/wrappers.go
@@ -219,9 +219,10 @@ func (j *JobWrapper) JobStatus(s rayv1.JobStatus) *JobWrapper {
 
 // Request adds a resource request to the default container.
 func (j *JobWrapper) Request(rayType rayv1.RayNodeType, r corev1.ResourceName, v string) *JobWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Resources.Requests[r] = resource.MustParse(v)
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Requests[r] = resource.MustParse(v)
 	}
 	return j
@@ -229,9 +230,10 @@ func (j *JobWrapper) Request(rayType rayv1.RayNodeType, r corev1.ResourceName, v
 
 // Limit adds a resource request to the default container.
 func (j *JobWrapper) Limit(rayType rayv1.RayNodeType, r corev1.ResourceName, v string) *JobWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Resources.Limits[r] = resource.MustParse(v)
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Limits[r] = resource.MustParse(v)
 	}
 	return j
@@ -243,11 +245,12 @@ func (j *JobWrapper) RequestAndLimit(rayType rayv1.RayNodeType, r corev1.Resourc
 }
 
 func (j *JobWrapper) Image(rayType rayv1.RayNodeType, image string, args ...string) *JobWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Image = image
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Args = args
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].ImagePullPolicy = corev1.PullIfNotPresent
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Image = image
 		j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Args = args
 		j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].ImagePullPolicy = corev1.PullIfNotPresent
@@ -266,12 +269,13 @@ func (j *JobWrapper) RayVersion(rv string) *JobWrapper {
 }
 
 func (j *JobWrapper) Env(rayType rayv1.RayNodeType, name, value string) *JobWrapper {
-	if rayType == rayv1.HeadNode {
+	switch rayType {
+	case rayv1.HeadNode:
 		if j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Env == nil {
 			j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Env = make([]corev1.EnvVar, 0)
 		}
 		j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Env = append(j.Spec.RayClusterSpec.HeadGroupSpec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: name, Value: value})
-	} else if rayType == rayv1.WorkerNode {
+	case rayv1.WorkerNode:
 		if j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Env == nil {
 			j.Spec.RayClusterSpec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Env = make([]corev1.EnvVar, 0)
 		}
diff --git a/pkg/util/testingjobs/tfjob/wrappers_tfjob.go b/pkg/util/testingjobs/tfjob/wrappers_tfjob.go
index fa1ad081c..4b6390df0 100644
--- a/pkg/util/testingjobs/tfjob/wrappers_tfjob.go
+++ b/pkg/util/testingjobs/tfjob/wrappers_tfjob.go
@@ -64,7 +64,7 @@ func (j *TFJobWrapper) TFReplicaSpecs(replicaSpecs ...TFReplicaSpecRequirement)
 		j.Spec.TFReplicaSpecs[rs.ReplicaType].Template.Spec.Containers[0].Name = "tensorflow"
 
 		if rs.Annotations != nil {
-			j.Spec.TFReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+			j.Spec.TFReplicaSpecs[rs.ReplicaType].Template.Annotations = rs.Annotations
 		}
 	}
 
diff --git a/pkg/util/testingjobs/xgboostjob/wrappers.go b/pkg/util/testingjobs/xgboostjob/wrappers.go
index b568a8ed2..aa0c60c90 100644
--- a/pkg/util/testingjobs/xgboostjob/wrappers.go
+++ b/pkg/util/testingjobs/xgboostjob/wrappers.go
@@ -64,7 +64,7 @@ func (j *XGBoostJobWrapper) XGBReplicaSpecs(replicaSpecs ...XGBReplicaSpecRequir
 		j.Spec.XGBReplicaSpecs[rs.ReplicaType].Template.Spec.Containers[0].Name = "xgboost"
 
 		if rs.Annotations != nil {
-			j.Spec.XGBReplicaSpecs[rs.ReplicaType].Template.ObjectMeta.Annotations = rs.Annotations
+			j.Spec.XGBReplicaSpecs[rs.ReplicaType].Template.Annotations = rs.Annotations
 		}
 	}
 
diff --git a/test/integration/singlecluster/scheduler/fairsharing/suite_test.go b/test/integration/singlecluster/scheduler/fairsharing/suite_test.go
index 6ffb0f0de..88756e4b2 100644
--- a/test/integration/singlecluster/scheduler/fairsharing/suite_test.go
+++ b/test/integration/singlecluster/scheduler/fairsharing/suite_test.go
@@ -77,7 +77,7 @@ func managerAndSchedulerSetup(ctx context.Context, mgr manager.Manager) {
 	queues := queue.NewManager(mgr.GetClient(), cCache)
 
 	configuration := &config.Configuration{FairSharing: fairSharing}
-	configuration.ControllerManager.Metrics.EnableClusterQueueResources = true
+	configuration.Metrics.EnableClusterQueueResources = true
 	mgr.GetScheme().Default(configuration)
 
 	failedCtrl, err := core.SetupControllers(mgr, queues, cCache, configuration)
diff --git a/test/integration/singlecluster/scheduler/workload_controller_test.go b/test/integration/singlecluster/scheduler/workload_controller_test.go
index 489ae502e..3f0a1464e 100644
--- a/test/integration/singlecluster/scheduler/workload_controller_test.go
+++ b/test/integration/singlecluster/scheduler/workload_controller_test.go
@@ -73,9 +73,9 @@ var _ = ginkgo.Describe("Workload controller with scheduler", func() {
 			check1            *kueue.AdmissionCheck
 			check2            *kueue.AdmissionCheck
 			check3            *kueue.AdmissionCheck
-			reservationFlavor string = "reservation"
+			reservationFlavor = "reservation"
 			updatedWl         kueue.Workload
-			flavorOnDemand    string              = "on-demand"
+			flavorOnDemand                        = "on-demand"
 			resourceGPU       corev1.ResourceName = "example.com/gpu"
 		)
 
diff --git a/test/integration/singlecluster/tas/tas_test.go b/test/integration/singlecluster/tas/tas_test.go
index e4835ebba..cc7e0e9b2 100644
--- a/test/integration/singlecluster/tas/tas_test.go
+++ b/test/integration/singlecluster/tas/tas_test.go
@@ -1562,7 +1562,7 @@ var _ = ginkgo.Describe("Topology validations", func() {
 			ginkgo.Entry("succeed to update topology",
 				testing.MakeDefaultOneLevelTopology("valid"),
 				func(topology *kueuealpha.Topology) {
-					topology.ObjectMeta.Labels = map[string]string{
+					topology.Labels = map[string]string{
 						"alpha": "beta",
 					}
 				},
diff --git a/test/util/e2e.go b/test/util/e2e.go
index c97350af7..39c730a74 100644
--- a/test/util/e2e.go
+++ b/test/util/e2e.go
@@ -93,8 +93,8 @@ func CreateClientUsingCluster(kContext string) (client.WithWatch, *rest.Config)
 	gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
 
 	cfg.APIPath = "/api"
-	cfg.ContentConfig.GroupVersion = &schema.GroupVersion{Group: "", Version: "v1"}
-	cfg.ContentConfig.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
+	cfg.GroupVersion = &schema.GroupVersion{Group: "", Version: "v1"}
+	cfg.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
 
 	err = awv1beta2.AddToScheme(scheme.Scheme)
 	gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())