Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
  • Loading branch information
everettraven committed Sep 8, 2023
1 parent 62dbdaa commit efa5262
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 63 deletions.
51 changes: 22 additions & 29 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
corecontrollers "github.com/operator-framework/catalogd/pkg/controllers/core"
"github.com/operator-framework/catalogd/pkg/features"
"github.com/operator-framework/catalogd/pkg/profile"
"github.com/operator-framework/catalogd/pkg/server"
catalogdserver "github.com/operator-framework/catalogd/pkg/server"
"github.com/operator-framework/catalogd/pkg/storage"

//+kubebuilder:scaffold:imports
Expand Down Expand Up @@ -126,37 +126,30 @@ func main() {
os.Exit(1)
}

var localStorage storage.Instance
if features.CatalogdFeatureGate.Enabled(features.HTTPServer) {
metrics.Registry.MustRegister(server.ApdexTargetMetric, server.RequestDurationMetric)
}

if err := os.MkdirAll(storageDir, 0700); err != nil {
setupLog.Error(err, "unable to create storage directory for catalogs")
}
<<<<<<< HEAD
localStorage := storage.LocalDir{RootDir: storageDir}
shutdownTimeout := 30 * time.Second
catalogServer := server.Server{
Kind: "catalogs",
Server: &http.Server{
Addr: catalogServerAddr,
Handler: localStorage.StorageServerHandler(),
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
},
ShutdownTimeout: &shutdownTimeout,
=======
metrics.Registry.MustRegister(catalogdserver.RequestDurationMetric)

if features.CatalogdFeatureGate.Enabled(features.HTTPServer) {
metrics.Registry.MustRegister(server.RequestDurationMetric)
srv := server.Instance{StorageDir: storageDir}
mgr.AddMetricsExtraHandler("/catalogs/", server.AddMetricsToHandler(srv.CatalogServerHandler()))
>>>>>>> dbb9540 (remove apdex target gauge, increase histogram buckets)
if err := os.MkdirAll(storageDir, 0700); err != nil {
setupLog.Error(err, "unable to create storage directory for catalogs")
}
localStorage = storage.LocalDir{RootDir: storageDir}
shutdownTimeout := 30 * time.Second
catalogServer := server.Server{
Kind: "catalogs",
Server: &http.Server{
Addr: catalogServerAddr,
Handler: catalogdserver.AddMetricsToHandler(localStorage.StorageServerHandler()),
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
},
ShutdownTimeout: &shutdownTimeout,
}
if err := mgr.Add(&catalogServer); err != nil {
setupLog.Error(err, "unable to start catalog server")
os.Exit(1)
}
}
if err := mgr.Add(&catalogServer); err != nil {
setupLog.Error(err, "unable to start catalog server")
os.Exit(1)


if err = (&corecontrollers.CatalogReconciler{
Client: mgr.GetClient(),
Expand Down
34 changes: 0 additions & 34 deletions pkg/server/server.go

This file was deleted.

0 comments on commit efa5262

Please sign in to comment.