Skip to content

Commit

Permalink
change MetricsHubHostname add logic
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Dec 3, 2024
1 parent f84c657 commit 48cdd60
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,12 @@ func (r *MCORenderer) renderAddonDeploymentConfig(
}
}

if r.rendererOptions != nil {
metricsHubHostname := r.rendererOptions.MCOAOptions.MetricsHubHostname
if metricsHubHostname != "" {
appendCustomVar(aodc, nameMetricsHubHostname, metricsHubHostname)
if (cs.Platform != nil && cs.Platform.Metrics.Collection.Enabled) ||
(cs.UserWorkloads != nil && cs.UserWorkloads.Metrics.Collection.Enabled) {
if r.rendererOptions == nil || r.rendererOptions.MCOAOptions.MetricsHubHostname == "" {
return nil, fmt.Errorf("MetricsHubHostname is required when metrics collection is enabled")
}
appendCustomVar(aodc, nameMetricsHubHostname, r.rendererOptions.MCOAOptions.MetricsHubHostname)
}

u.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(aodc)
Expand Down

0 comments on commit 48cdd60

Please sign in to comment.