Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ linters:
- asciicheck
- bodyclose
- errorlint
- gci
- ginkgolinter
- gofmt
- goimports
Expand Down Expand Up @@ -46,6 +47,15 @@ linters-settings:
alias: rukpakv1alpha1
goimports:
local-prefixes: github.com/operator-framework/catalogd

gci:
sections:
- standard
- default
- prefix(github.com/operator-framework)
- prefix(github.com/operator-framework/catalogd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use localmodule here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like localmodule is only working in gci 0.13.4 which isn't included in a release of golangci-lint yet.

custom-order: true

output:
format: tab
formats:
- format: tab
15 changes: 6 additions & 9 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ import (
"path/filepath"
"time"

"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we have conflicting linters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's due to the following comments on 32-33. Removing those fixes the incompatibility.

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
"k8s.io/client-go/metadata"
_ "k8s.io/client-go/plugin/pkg/client/auth"

"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/metrics"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

"github.com/spf13/pflag"

//+kubebuilder:scaffold:imports
"github.com/operator-framework/catalogd/api/core/v1alpha1"
"github.com/operator-framework/catalogd/internal/garbagecollection"
"github.com/operator-framework/catalogd/internal/source"
"github.com/operator-framework/catalogd/internal/third_party/server"
Expand All @@ -49,9 +49,6 @@ import (
"github.com/operator-framework/catalogd/pkg/features"
catalogdmetrics "github.com/operator-framework/catalogd/pkg/metrics"
"github.com/operator-framework/catalogd/pkg/storage"

//+kubebuilder:scaffold:imports
"github.com/operator-framework/catalogd/api/core/v1alpha1"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions pkg/controllers/core/catalog_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/google/go-cmp/cmp/cmpopts"

catalogdv1alpha1 "github.com/operator-framework/catalogd/api/core/v1alpha1"
"github.com/operator-framework/catalogd/internal/source"
"github.com/operator-framework/catalogd/pkg/storage"
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/localdir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/google/go-cmp/cmp"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/operator-framework/operator-registry/alpha/declcfg"
)

Expand Down