Skip to content
Merged
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
24 changes: 12 additions & 12 deletions control-plane/subcommand/sync-catalog/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,18 @@ func (c *Command) Run(args []string) int {
}
}

// Start healthcheck handler
go func() {
mux := http.NewServeMux()
mux.HandleFunc("/health/ready", c.handleReady)
var handler http.Handler = mux

c.UI.Info(fmt.Sprintf("Listening on %q...", c.flagListen))
if err := http.ListenAndServe(c.flagListen, handler); err != nil {
c.UI.Error(fmt.Sprintf("Error listening: %s", err))
}
}()

// Convert allow/deny lists to sets
allowSet := flags.ToSet(c.flagAllowK8sNamespacesList)
denySet := flags.ToSet(c.flagDenyK8sNamespacesList)
Expand Down Expand Up @@ -329,18 +341,6 @@ func (c *Command) Run(args []string) int {
}()
}

// Start healthcheck handler
go func() {
mux := http.NewServeMux()
mux.HandleFunc("/health/ready", c.handleReady)
var handler http.Handler = mux

c.UI.Info(fmt.Sprintf("Listening on %q...", c.flagListen))
if err := http.ListenAndServe(c.flagListen, handler); err != nil {
c.UI.Error(fmt.Sprintf("Error listening: %s", err))
}
}()

select {
// Unexpected exit
case <-toConsulCh:
Expand Down
Loading