Skip to content

Commit

Permalink
fix: other assorted changes for latest crossplane and controller runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Albury <[email protected]>
Signed-off-by: nalbury <[email protected]>
  • Loading branch information
nalbury committed Nov 17, 2023
1 parent a7ffbba commit 5f68421
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"gopkg.in/alecthomas/kingpin.v2"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/crossplane/crossplane-runtime/pkg/logging"
Expand Down Expand Up @@ -56,7 +57,9 @@ func main() {
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
LeaderElection: *leaderElection,
LeaderElectionID: "crossplane-leader-election-provider-kafka",
SyncPeriod: syncPeriod,
Cache: cache.Options{
SyncPeriod: syncPeriod,
},
})
kingpin.FatalIfError(err, "Cannot create controller manager")

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/acl/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (c *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext
}
if meta.GetExternalName(cr) == "" {
meta.SetExternalName(cr, extname)
return managed.ExternalCreation{ExternalNameAssigned: true}, acl.Create(ctx, c.kafkaClient, generated)
return managed.ExternalCreation{}, acl.Create(ctx, c.kafkaClient, generated)
}

return managed.ExternalCreation{}, acl.Create(ctx, c.kafkaClient, generated)
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package config
import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/crossplane/crossplane-runtime/pkg/event"
"github.com/crossplane/crossplane-runtime/pkg/logging"
Expand Down Expand Up @@ -48,7 +47,7 @@ func Setup(mgr ctrl.Manager, l logging.Logger) error {
Named(name).
WithOptions(o).
For(&v1alpha1.ProviderConfig{}).
Watches(&source.Kind{Type: &v1alpha1.ProviderConfigUsage{}}, &resource.EnqueueRequestForProviderConfig{}).
Watches(&v1alpha1.ProviderConfigUsage{}, &resource.EnqueueRequestForProviderConfig{}).
Complete(providerconfig.NewReconciler(mgr, of,
providerconfig.WithLogger(l.WithValues("controller", name)),
providerconfig.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name)))))
Expand Down

0 comments on commit 5f68421

Please sign in to comment.