Skip to content

Commit 5741a2c

Browse files
committed
metrics: Maintain legacy TLS profile in HyperShift
To be fixed after the hosted control plane components propagate the TLS profile to the CVO. To be done. In the meantime, maintain the previous logic.
1 parent c2493e5 commit 5741a2c

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

pkg/cvo/metrics.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ type MetricsOptions struct {
351351

352352
DisableAuthentication bool
353353
DisableAuthorization bool
354+
355+
RespectCentralTLSProfile bool
354356
}
355357

356358
// RunMetrics launches an HTTPS server bound to listenAddress serving
@@ -491,12 +493,14 @@ func RunMetrics(runContext context.Context, shutdownContext context.Context, res
491493
return nil, err
492494
}
493495

494-
profile, err := getAPIServerTLSProfile(apiServerLister, lastValidProfile)
495-
if err != nil {
496-
return nil, fmt.Errorf("failed to get TLS profile for metrics server: %w", err)
496+
if options.RespectCentralTLSProfile {
497+
profile, err := getAPIServerTLSProfile(apiServerLister, lastValidProfile)
498+
if err != nil {
499+
return nil, fmt.Errorf("failed to get TLS profile for metrics server: %w", err)
500+
}
501+
lastValidProfile = profile
502+
profile.apply(config)
497503
}
498-
lastValidProfile = profile
499-
profile.apply(config)
500504

501505
return config, nil
502506
},

pkg/start/start.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ func (o *Options) ValidateAndComplete() error {
162162
o.MetricsOptions.DisableAuthorization = o.HyperShift
163163
o.MetricsOptions.DisableAuthentication = o.HyperShift
164164

165+
// Continue functioning the same way in HyperShift, as the CVO is in the management cluster
166+
o.MetricsOptions.RespectCentralTLSProfile = !o.HyperShift
167+
165168
if err := validateCapabilities(o.AlwaysEnableCapabilities); err != nil {
166169
return fmt.Errorf("--always-enable-capabilities: %w", err)
167170
}

0 commit comments

Comments
 (0)