Skip to content

Commit a68cc3f

Browse files
committed
chore: remove diagnostics server from manager
1 parent 569ae25 commit a68cc3f

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed

controller/controlplane/controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
376376
if err != nil {
377377
return ctrl.Result{}, fmt.Errorf("failed to create manager config: %w", err)
378378
}
379-
mgrCfg.DisableRunningDiagnosticsServer = true
380379
if err := r.scheduleInstance(ctx, logger, mgrID, mgrCfg); err != nil {
381380
return r.handleScheduleInstanceOutcome(ctx, logger, cp, err)
382381
}
@@ -403,7 +402,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
403402
if err != nil {
404403
return ctrl.Result{}, fmt.Errorf("failed to create manager config: %w", err)
405404
}
406-
mgrCfg.DisableRunningDiagnosticsServer = true
407405
hashFromSpec, errSpec := managercfg.Hash(mgrCfg)
408406
if errSpec != nil {
409407
return ctrl.Result{}, fmt.Errorf("failed to hash ControlPlane config options: %w", errSpec)

ingress-controller/internal/manager/run.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ type Manager struct {
6161
cfg managercfg.Config
6262
m manager.Manager
6363
synchronizer *dataplane.Synchronizer
64-
diagnosticsServer mo.Option[diagnostics.Server]
6564
diagnosticsCollector mo.Option[*diagnostics.Collector]
6665
diagnosticsHandler mo.Option[*diagnostics.HTTPHandler]
6766
admissionServer mo.Option[*admission.Server]
@@ -487,14 +486,6 @@ func (m *Manager) setupDiagnostics(
487486
serverOpts = append(serverOpts, diagnostics.WithConfigDiagnostics(m.diagnosticsHandler.MustGet()))
488487
}
489488

490-
if !c.DisableRunningDiagnosticsServer {
491-
m.diagnosticsServer = mo.Some(diagnostics.NewServer(logger, diagnostics.ServerConfig{
492-
ProfilingEnabled: c.EnableProfiling,
493-
DumpSensitiveConfig: c.DumpSensitiveConfig,
494-
ListenerPort: c.DiagnosticServerPort,
495-
}, serverOpts...))
496-
}
497-
498489
// If diagnosticsCollector is set, it means that config dumps are enabled and we should return a diagnostics.Client.
499490
if dc, ok := m.diagnosticsCollector.Get(); ok {
500491
return mo.Some(dc.Client())
@@ -509,15 +500,6 @@ func (m *Manager) Run(ctx context.Context) error {
509500
logger := ctrl.LoggerFrom(ctx)
510501
logger.Info("Starting manager")
511502

512-
if ds, ok := m.diagnosticsServer.Get(); ok {
513-
go func() {
514-
logger.Info("Starting diagnostics server")
515-
if err := ds.Listen(ctx); err != nil {
516-
logger.Error(err, "Diagnostics server exited")
517-
}
518-
}()
519-
}
520-
521503
if dc, ok := m.diagnosticsCollector.Get(); ok {
522504
go func() {
523505
logger.Info("Starting diagnostics collector")

ingress-controller/pkg/manager/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ type Config struct {
135135
EnableConfigDumps bool
136136
DumpSensitiveConfig bool
137137
DiagnosticServerPort int
138-
// TODO: https://github.com/Kong/kubernetes-ingress-controller/issues/7285
139-
// instead of this toggle, move the server out of the internal.Manager
140-
DisableRunningDiagnosticsServer bool
141138

142139
// EnableDrainSupport controls whether to include terminating endpoints in Kong upstreams
143140
// with weight=0 for graceful connection draining

ingress-controller/test/envtest/run.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ func WithDiagnosticsServer(port int) func(cfg *managercfg.Config) {
131131
func WithDiagnosticsWithoutServer() func(cfg *managercfg.Config) {
132132
return func(cfg *managercfg.Config) {
133133
cfg.EnableConfigDumps = true
134-
cfg.DisableRunningDiagnosticsServer = true
135134
}
136135
}
137136

0 commit comments

Comments
 (0)