Skip to content

Commit

Permalink
Merge branch 'nephio-project:main' into add_git_tls
Browse files Browse the repository at this point in the history
  • Loading branch information
efiacor authored May 27, 2024
2 parents d4fd3e7 + a03a8d2 commit 83b5ce3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
"sigs.k8s.io/controller-runtime/pkg/client"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

Expand All @@ -41,6 +42,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

porchapi "github.com/nephio-project/porch/api/porch/v1alpha1"
"github.com/nephio-project/porch/controllers/fleetsyncs/pkg/controllers/fleetsync"
"github.com/nephio-project/porch/controllers/packagevariants/pkg/controllers/packagevariant"
"github.com/nephio-project/porch/controllers/packagevariantsets/pkg/controllers/packagevariantset"
Expand Down Expand Up @@ -117,19 +119,29 @@ func run(ctx context.Context) error {
return fmt.Errorf("error initializing scheme: %w", err)
}

if err := porchapi.AddToScheme(scheme); err != nil {
return fmt.Errorf("error initializing scheme: %w", err)
}

managerOptions := ctrl.Options{
Scheme: scheme,
Metrics: metricsserver.Options{
Scheme: scheme,
Metrics: metricsserver.Options{
BindAddress: ":8080",
},
WebhookServer: webhook.NewServer(webhook.Options{
WebhookServer: webhook.NewServer(webhook.Options{
Port: 9443,
}),
HealthProbeBindAddress: ":8081",
LeaderElection: false,
LeaderElectionID: "porch-operators.config.porch.kpt.dev",
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
MapperProvider: controllerrestmapper.New,
Client: client.Options{
Cache: &client.CacheOptions{
DisableFor: []client.Object{
&porchapi.PackageRevisionResources{}},
},
},
}

ctrl.SetLogger(klogr.New())
Expand Down

0 comments on commit 83b5ce3

Please sign in to comment.