2323 testNamespace = fmt .Sprintf ("%s-ns" , testName )
2424 clientName = fmt .Sprintf ("%s-client" , testName )
2525 kedaOperatorMetricsURL = "https://keda-add-ons-http-operator-metrics.keda:8443/metrics"
26- kedaOperatorMetricsHTTPURL = "http://keda-add-ons-http-operator-metrics.keda:8443/metrics"
2726 operatorPodSelector = "app.kubernetes.io/instance=operator"
2827)
2928
@@ -88,12 +87,8 @@ func TestOperatorMetrics(t *testing.T) {
8887 t .Log ("Test 1: Verify HTTPS endpoint is available" )
8988 testHTTPSEndpoint (t )
9089
91- // Test 2: HTTP should not work (redirected or refused)
92- t .Log ("Test 2: Verify HTTP endpoint is not accessible" )
93- testHTTPEndpointNotAccessible (t )
94-
95- // Test 3: Verify metrics are returned
96- t .Log ("Test 3: Verify metrics content" )
90+ // Test 2: Verify metrics are returned
91+ t .Log ("Test 2: Verify metrics content" )
9792 testMetricsContent (t )
9893
9994 // cleanup
@@ -115,16 +110,6 @@ func testHTTPSEndpoint(t *testing.T) {
115110 "HTTPS endpoint should respond (either with metrics or authentication error)" )
116111}
117112
118- func testHTTPEndpointNotAccessible (t * testing.T ) {
119- // Try HTTP - should fail or redirect
120- cmd := fmt .Sprintf ("curl --max-time 10 %s" , kedaOperatorMetricsHTTPURL )
121- out , errOut , err := ExecCommandOnSpecificPod (t , clientName , testNamespace , cmd )
122-
123- // HTTP should not work since we're using SecureServing
124- assert .True (t , err != nil || strings .Contains (errOut , "Empty reply" ) || strings .Contains (out , "Empty reply" ),
125- "HTTP endpoint should not be accessible. Output: %s, Error: %s" , out , errOut )
126- }
127-
128113func testMetricsContent (t * testing.T ) {
129114 // Get the operator pod name
130115 pods , err := KubeClient .CoreV1 ().Pods ("keda" ).List (context .Background (), metav1.ListOptions {
0 commit comments