(t *testing.T, objs ...runtime.Object)
| 196 | } |
| 197 | |
| 198 | func newTestFactory(t *testing.T, objs ...runtime.Object) *DefaultHttpClientsFactory { |
| 199 | t.Helper() |
| 200 | |
| 201 | systemCertPool, err := x509.SystemCertPool() |
| 202 | require.NoError(t, err) |
| 203 | |
| 204 | scheme := runtime.NewScheme() |
| 205 | require.NoError(t, corev1.AddToScheme(scheme)) |
| 206 | |
| 207 | k8sClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(objs...).Build() |
| 208 | |
| 209 | healthCheckTransport := http.DefaultTransport.(*http.Transport).Clone() |
| 210 | healthCheckTransport.TLSClientConfig = &tls.Config{ |
| 211 | InsecureSkipVerify: true, |
| 212 | } |
| 213 | |
| 214 | return &DefaultHttpClientsFactory{ |
| 215 | k8s: k8sClient, |
| 216 | logger: zap.New(zap.UseDevMode(true)), |
| 217 | systemCertPool: systemCertPool, |
| 218 | healthCheckHttpClient: &http.Client{ |
| 219 | Transport: healthCheckTransport, |
| 220 | Timeout: 500 * time.Millisecond, |
| 221 | }, |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | func routingConfigWithProxy(httpProxy, httpsProxy, noProxy string) *controller.RoutingConfig { |
| 226 | return &controller.RoutingConfig{ |
no outgoing calls
no test coverage detected