diff --git a/.golangci.yml b/.golangci.yml index f6305b15132..33d7ac791a0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -43,6 +43,15 @@ linters-settings: alias: $1$2 - pkg: github.com/openshift/api/(\w+)/(v[\w\d]+) alias: $1$2 + ireturn: + allow: + # defaults https://golangci-lint.run/usage/linters/#ireturn + - anon + - error + - empty + - stdlib + # also allow generics + - generic revive: rules: - name: dot-imports diff --git a/controllers/status/reporter.go b/controllers/status/reporter.go index e5b3679ff32..de9dbe7e6fc 100644 --- a/controllers/status/reporter.go +++ b/controllers/status/reporter.go @@ -1,4 +1,3 @@ -//nolint:ireturn //reason: return T which is expected to be satisfying client.Object interface package status import ( diff --git a/pkg/plugins/addLabelsplugin.go b/pkg/plugins/addLabelsplugin.go index 573a19f2ad2..5991c157d4c 100644 --- a/pkg/plugins/addLabelsplugin.go +++ b/pkg/plugins/addLabelsplugin.go @@ -15,8 +15,8 @@ import ( // - It adds labels to the "metadata/labels" path for all resource kinds. // - It adds labels to the "spec/template/metadata/labels" and "spec/selector/matchLabels" paths // for resources of kind "Deployment". -func CreateAddLabelsPlugin(componentName string) builtins.LabelTransformerPlugin { - return builtins.LabelTransformerPlugin{ +func CreateAddLabelsPlugin(componentName string) *builtins.LabelTransformerPlugin { + return &builtins.LabelTransformerPlugin{ Labels: map[string]string{ labels.ODH.Component(componentName): "true", labels.K8SCommon.PartOf: componentName, diff --git a/pkg/plugins/namespacePlugin.go b/pkg/plugins/namespacePlugin.go index 7060b6330c4..5204fdaa892 100644 --- a/pkg/plugins/namespacePlugin.go +++ b/pkg/plugins/namespacePlugin.go @@ -8,8 +8,8 @@ import ( ) // CreateNamespaceApplierPlugin creates a plugin to ensure resources have the specified target namespace. -func CreateNamespaceApplierPlugin(targetNamespace string) builtins.NamespaceTransformerPlugin { - return builtins.NamespaceTransformerPlugin{ +func CreateNamespaceApplierPlugin(targetNamespace string) *builtins.NamespaceTransformerPlugin { + return &builtins.NamespaceTransformerPlugin{ ObjectMeta: types.ObjectMeta{ Name: "odh-namespace-plugin", Namespace: targetNamespace,