Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Add an init function for logserver #1943

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/cli/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cli
import (
minkserver "github.com/acorn-io/mink/pkg/server"
cli "github.com/acorn-io/runtime/pkg/cli/builder"
"github.com/acorn-io/runtime/pkg/logserver"
_ "github.com/acorn-io/runtime/pkg/logserver/init"
"github.com/acorn-io/runtime/pkg/server"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -41,8 +41,6 @@ func (a *APIServer) Run(cmd *cobra.Command, args []string) error {
return err
}

logserver.StartServerWithDefaults()

<-cmd.Context().Done()
return cmd.Context().Err()
}
3 changes: 1 addition & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/acorn-io/runtime/pkg/event"
"github.com/acorn-io/runtime/pkg/imagesystem"
"github.com/acorn-io/runtime/pkg/k8sclient"
"github.com/acorn-io/runtime/pkg/logserver"
_ "github.com/acorn-io/runtime/pkg/logserver/init"
"github.com/acorn-io/runtime/pkg/scheme"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down Expand Up @@ -104,7 +104,6 @@ func (c *Controller) Start(ctx context.Context) error {
go wait.UntilWithContext(ctx, dnsInit.RenewAndSync, dnsRenewPeriodHours)

autoupgrade.StartSync(ctx, c.Router.Backend())
logserver.StartServerWithDefaults()
}()

return c.Router.Start(ctx)
Expand Down
7 changes: 7 additions & 0 deletions pkg/logserver/init/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package init

import "github.com/acorn-io/runtime/pkg/logserver"

func init() {
go logserver.StartServerWithDefaults()
}