squakez commented on code in PR #6969:
URL: https://github.com/apache/camel-k/pull/6969#discussion_r4639548802


##########
pkg/cmd/operator/operator.go:
##########
@@ -251,6 +255,46 @@ func Run(healthPort, monitoringPort int32, leaderElection 
bool, leaderElectionID
        exitOnError(mgr.Start(ctx), "manager exited non-zero")
 }
 
+func newMetricsServerOptions(ctx context.Context, kubeClient ctrl.Reader, 
monitoringPort int32, operatorNamespace, secretName string) 
(metricsserver.Options, error) {
+       options := metricsserver.Options{
+               BindAddress: ":" + strconv.Itoa(int(monitoringPort)),
+       }
+       if secretName == "" {
+               return options, nil
+       }
+
+       secret, err := kubernetes.GetSecret(ctx, kubeClient, secretName, 
operatorNamespace)

Review Comment:
   I'd prefer to avoid reading a secret here. This would require the need of 
high privilege. If there is no alternative, then, we should provide a fixed 
named secret in order to narrow down the scope on a single secret on the 
operator namespace only.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to