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


##########
pkg/cmd/operator/operator_test.go:
##########
@@ -221,3 +231,48 @@ func TestGetOperatorImage(t *testing.T) {
                assert.Empty(t, image)
        })
 }
+
+type managerRoundTripper func(*http.Request) (*http.Response, error)
+
+func (f managerRoundTripper) RoundTrip(request *http.Request) (*http.Response, 
error) {
+       return f(request)
+}
+
+func TestManagerClientReadsCamelMonitorsWithoutStartingAnInformer(t 
*testing.T) {

Review Comment:
   Too much complicated. We should test via "normal" fake client as with other 
resources



##########
pkg/cmd/operator/operator.go:
##########
@@ -358,3 +362,12 @@ func exitOnError(err error, msg string) {
                os.Exit(1)
        }
 }
+
+// Read optional CamelMonitor resources directly even when their watch is 
disabled.

Review Comment:
   Not sure to understand why. I think we need to watch the `cmon` resources 
and update the condition if the cmon exist or it was removed.



##########
pkg/cmd/operator/operator.go:
##########
@@ -226,6 +229,7 @@ func Run(healthPort, monitoringPort int32, leaderElection 
bool, leaderElectionID
                HealthProbeBindAddress:        ":" + 
strconv.Itoa(int(healthPort)),
                Metrics:                       
metricsserver.Options{BindAddress: ":" + strconv.Itoa(int(monitoringPort))},
                Cache:                         options,
+               NewClient:                     newManagerClient,

Review Comment:
   Why is this needed?



-- 
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