fix(lint): resolve all golangci-lint findings

Migrate the lint config to the v2 format.
Replace the deprecated scheme.Builder with runtime.NewSchemeBuilder.
Handle Close errors in the worker and replace repeated strings with constants.
Remove unused parameters and use switch statements where the linter asks.
This commit is contained in:
2026-10-02 10:37:06 +01:00
parent c87d3eb56e
commit 2fdce1bf21
12 changed files with 149 additions and 120 deletions
+6 -2
View File
@@ -20,8 +20,9 @@ limitations under the License.
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
@@ -29,7 +30,10 @@ var (
GroupVersion = schema.GroupVersion{Group: "raczylo.com", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
SchemeBuilder = runtime.NewSchemeBuilder(func(s *runtime.Scheme) error {
metav1.AddToGroupVersion(s, GroupVersion)
return nil
})
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme