@@ -51,7 +51,18 @@ func Test_Reconcile(t *testing.T) {
5151 }
5252 }
5353
54- istio := func (version string , gieEnabled bool ) * sailv1.Istio {
54+ proxyConfig := func (http , https , noproxy string ) * configv1.Proxy {
55+ return & configv1.Proxy {
56+ ObjectMeta : metav1.ObjectMeta {Name : "cluster" },
57+ Status : configv1.ProxyStatus {
58+ HTTPProxy : http ,
59+ HTTPSProxy : https ,
60+ NoProxy : noproxy ,
61+ },
62+ }
63+ }
64+
65+ istio := func (version string , gieEnabled bool , proxyconfig map [string ]string ) * sailv1.Istio {
5566 ret := & sailv1.Istio {
5667 ObjectMeta : metav1.ObjectMeta {
5768 Name : "openshift-gateway" ,
@@ -110,6 +121,7 @@ func Test_Reconcile(t *testing.T) {
110121 Mode : sailv1 .ProxyConfigProxyHeadersMetadataExchangeModeInMesh ,
111122 },
112123 },
124+ ProxyMetadata : proxyconfig ,
113125 },
114126 IngressControllerMode : sailv1 .MeshConfigIngressControllerModeOff ,
115127 },
@@ -158,7 +170,7 @@ func Test_Reconcile(t *testing.T) {
158170 },
159171 expectCreate : []client.Object {
160172 subscription ("redhat-operators" , "stable" , "servicemeshoperator3.v3.0.1" ),
161- istio ("v1.24.4" , false ),
173+ istio ("v1.24.4" , false , nil ),
162174 },
163175 expectUpdate : []client.Object {},
164176 expectDelete : []client.Object {},
@@ -183,7 +195,7 @@ func Test_Reconcile(t *testing.T) {
183195 },
184196 expectCreate : []client.Object {
185197 subscription ("redhat-operators" , "stable" , "servicemeshoperator3.v3.0.1" ),
186- istio ("v1.24.4" , true ),
198+ istio ("v1.24.4" , true , nil ),
187199 },
188200 expectUpdate : []client.Object {},
189201 expectDelete : []client.Object {},
@@ -208,7 +220,7 @@ func Test_Reconcile(t *testing.T) {
208220 },
209221 expectCreate : []client.Object {
210222 subscription ("redhat-operators" , "stable" , "servicemeshoperator3.v3.0.1" ),
211- istio ("v1.24.4" , true ),
223+ istio ("v1.24.4" , true , nil ),
212224 },
213225 expectUpdate : []client.Object {},
214226 expectDelete : []client.Object {},
@@ -231,7 +243,7 @@ func Test_Reconcile(t *testing.T) {
231243 },
232244 expectCreate : []client.Object {
233245 subscription ("redhat-operators" , "stable" , "servicemeshoperator3.v3.0.1" ),
234- istio ("v1.24-latest" , false ),
246+ istio ("v1.24-latest" , false , nil ),
235247 },
236248 expectUpdate : []client.Object {},
237249 expectDelete : []client.Object {},
@@ -257,7 +269,32 @@ func Test_Reconcile(t *testing.T) {
257269 },
258270 expectCreate : []client.Object {
259271 subscription ("foo" , "bar" , "baz" ),
260- istio ("quux" , false ),
272+ istio ("quux" , false , nil ),
273+ },
274+ expectUpdate : []client.Object {},
275+ expectDelete : []client.Object {},
276+ },
277+ {
278+ name : "Minimal gatewayclass with httproxy override" ,
279+ request : req ("openshift-default" ),
280+ existingObjects : []runtime.Object {
281+ & gatewayapiv1.GatewayClass {
282+ ObjectMeta : metav1.ObjectMeta {
283+ Name : "openshift-default" ,
284+ },
285+ Spec : gatewayapiv1.GatewayClassSpec {
286+ ControllerName : gatewayapiv1 .GatewayController ("openshift.io/gateway-controller/v1" ),
287+ },
288+ },
289+ proxyConfig ("http://some.proxy.tld:8080" , "https://another.proxy.tld" , ".cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14" ),
290+ },
291+ expectCreate : []client.Object {
292+ subscription ("redhat-operators" , "stable" , "servicemeshoperator3.v3.0.1" ),
293+ istio ("v1.24.4" , false , map [string ]string {
294+ "HTTP_PROXY" : "http://some.proxy.tld:8080" ,
295+ "HTTPS_PROXY" : "https://another.proxy.tld" ,
296+ "NO_PROXY" : ".cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14" ,
297+ }),
261298 },
262299 expectUpdate : []client.Object {},
263300 expectDelete : []client.Object {},
0 commit comments