Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: everettraven <[email protected]>
  • Loading branch information
everettraven committed Aug 16, 2024
1 parent 5cf0503 commit 8891a5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,15 @@ func main() {

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

if err = (&controllers.ClusterExtensionReconciler{
Client: cl,
Expand Down
2 changes: 1 addition & 1 deletion internal/applier/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"helm.sh/helm/v3/pkg/storage/driver"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
apimachyaml "k8s.io/apimachinery/pkg/util/yaml"
"sigs.k8s.io/controller-runtime/pkg/client"

helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
Expand All @@ -25,7 +26,6 @@ import (
"github.com/operator-framework/operator-controller/internal/rukpak/convert"
"github.com/operator-framework/operator-controller/internal/rukpak/preflights/crdupgradesafety"
"github.com/operator-framework/operator-controller/internal/rukpak/util"
apimachyaml "k8s.io/apimachinery/pkg/util/yaml"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/contentmanager/contentmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/dynamic/dynamicinformer"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand All @@ -24,7 +25,6 @@ import (

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

// Manager is a utility to manage content caches belonging
Expand Down Expand Up @@ -97,7 +97,7 @@ func NewManager(rcm RestConfigMapper, cfg *rest.Config, mapper meta.RESTMapper,
// - IF a cache does not already exist, create one
// - 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.
// - Stop and remove any sources that need to be stopped and removed
// - 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
// - 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
// - Update and set the cache with the newly created sources
//
// An error is returned in the following cases:
Expand Down
2 changes: 1 addition & 1 deletion internal/contentmanager/dynamicsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (dis *DynamicInformerSource) Start(ctx context.Context, q workqueue.RateLim
dis.mu.Unlock()
})

wait.PollUntilContextCancel(informerCtx, time.Second, true, func(ctx context.Context) (bool, error) {
_ = wait.PollUntilContextCancel(informerCtx, time.Second, true, func(ctx context.Context) (bool, error) {
if sharedIndexInf.HasSynced() {
syncOnce()
return true, nil
Expand Down
1 change: 0 additions & 1 deletion internal/contentmanager/eventhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
logf "sigs.k8s.io/controller-runtime/pkg/log"

"sigs.k8s.io/controller-runtime/pkg/predicate"
)

Expand Down

0 comments on commit 8891a5e

Please sign in to comment.