Skip to content

Commit b9a2637

Browse files
committed
fix lint issues
Signed-off-by: everettraven <[email protected]>
1 parent 86a0056 commit b9a2637

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

Diff for: cmd/manager/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,15 @@ func main() {
256256

257257
cm := contentmanager.NewManager(clientRestConfigMapper, mgr.GetConfig(), mgr.GetRESTMapper())
258258
contentManagerFinalizerKey := fmt.Sprintf("%s/contentmanager-cleanup", domain)
259-
clusterExtensionFinalizers.Register(contentManagerFinalizerKey, finalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
259+
err = clusterExtensionFinalizers.Register(contentManagerFinalizerKey, finalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
260260
ext := obj.(*ocv1alpha1.ClusterExtension)
261261
cm.Delete(ext)
262262
return crfinalizer.Result{}, nil
263263
}))
264+
if err != nil {
265+
setupLog.Error(err, "unable to register content manager cleanup finalizer")
266+
os.Exit(1)
267+
}
264268

265269
if err = (&controllers.ClusterExtensionReconciler{
266270
Client: cl,

Diff for: internal/applier/helm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"helm.sh/helm/v3/pkg/storage/driver"
1818
corev1 "k8s.io/api/core/v1"
1919
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
20+
apimachyaml "k8s.io/apimachinery/pkg/util/yaml"
2021
"sigs.k8s.io/controller-runtime/pkg/client"
2122

2223
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
@@ -25,7 +26,6 @@ import (
2526
"github.com/operator-framework/operator-controller/internal/rukpak/convert"
2627
"github.com/operator-framework/operator-controller/internal/rukpak/preflights/crdupgradesafety"
2728
"github.com/operator-framework/operator-controller/internal/rukpak/util"
28-
apimachyaml "k8s.io/apimachinery/pkg/util/yaml"
2929
)
3030

3131
const (

Diff for: internal/contentmanager/contentmanager.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"k8s.io/apimachinery/pkg/runtime/schema"
1616
"k8s.io/apimachinery/pkg/util/sets"
1717
"k8s.io/client-go/dynamic"
18+
"k8s.io/client-go/dynamic/dynamicinformer"
1819
"k8s.io/client-go/rest"
1920
"sigs.k8s.io/controller-runtime/pkg/client"
2021
"sigs.k8s.io/controller-runtime/pkg/controller"
@@ -24,7 +25,6 @@ import (
2425

2526
"github.com/operator-framework/operator-controller/api/v1alpha1"
2627
oclabels "github.com/operator-framework/operator-controller/internal/labels"
27-
"k8s.io/client-go/dynamic/dynamicinformer"
2828
)
2929

3030
// Manager is a utility to manage content caches belonging
@@ -97,7 +97,7 @@ func NewManager(rcm RestConfigMapper, cfg *rest.Config, mapper meta.RESTMapper,
9797
// - IF a cache does not already exist, create one
9898
// - IF a cache already exists, calculate the difference between sources that have already been created. Identify which new sources need to be created and which need to be stopped and removed.
9999
// - Stop and remove any sources that need to be stopped and removed
100-
// - Create new sources, filtering the content they recieve from the Kubernetes API server with the labels that should be set on content managed by the provided ClusterExtension
100+
// - Create new sources, filtering the content they receive from the Kubernetes API server with the labels that should be set on content managed by the provided ClusterExtension
101101
// - Update and set the cache with the newly created sources
102102
//
103103
// An error is returned in the following cases:

Diff for: internal/contentmanager/dynamicsource.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (dis *DynamicInformerSource) Start(ctx context.Context, q workqueue.RateLim
131131
dis.mu.Unlock()
132132
})
133133

134-
wait.PollUntilContextCancel(informerCtx, time.Second, true, func(ctx context.Context) (bool, error) {
134+
_ = wait.PollUntilContextCancel(informerCtx, time.Second, true, func(ctx context.Context) (bool, error) {
135135
if sharedIndexInf.HasSynced() {
136136
syncOnce()
137137
return true, nil

Diff for: internal/contentmanager/eventhandler.go

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
"sigs.k8s.io/controller-runtime/pkg/event"
4747
"sigs.k8s.io/controller-runtime/pkg/handler"
4848
logf "sigs.k8s.io/controller-runtime/pkg/log"
49-
5049
"sigs.k8s.io/controller-runtime/pkg/predicate"
5150
)
5251

0 commit comments

Comments
 (0)