@@ -65,7 +65,7 @@ func (d *adcClient) getConfigs(rk ResourceKind) []adcConfig {
6565 return d .configs [rk ]
6666}
6767
68- func (d * adcClient ) getConfigsForGatewayProxy (rk ResourceKind , tctx * provider.TranslateContext , gatewayProxy * v1alpha1.GatewayProxy ) (* adcConfig , error ) {
68+ func (d * adcClient ) getConfigsForGatewayProxy (tctx * provider.TranslateContext , gatewayProxy * v1alpha1.GatewayProxy ) (* adcConfig , error ) {
6969 if gatewayProxy == nil || gatewayProxy .Spec .Provider == nil {
7070 return nil , nil
7171 }
@@ -89,7 +89,8 @@ func (d *adcClient) getConfigsForGatewayProxy(rk ResourceKind, tctx *provider.Tr
8989 if provider .ControlPlane .Auth .AdminKey .ValueFrom != nil && provider .ControlPlane .Auth .AdminKey .ValueFrom .SecretKeyRef != nil {
9090 secretRef := provider .ControlPlane .Auth .AdminKey .ValueFrom .SecretKeyRef
9191 secret , ok := tctx .Secrets [types.NamespacedName {
92- Namespace : rk .Namespace ,
92+ // we should use gateway proxy namespace
93+ Namespace : gatewayProxy .GetNamespace (),
9394 Name : secretRef .Name ,
9495 }]
9596 if ok {
@@ -112,7 +113,7 @@ func (d *adcClient) getConfigsForGatewayProxy(rk ResourceKind, tctx *provider.Tr
112113func (d * adcClient ) updateConfigs (rk ResourceKind , tctx * provider.TranslateContext ) error {
113114 var configs []adcConfig
114115 for _ , gatewayProxy := range tctx .GatewayProxies {
115- config , err := d .getConfigsForGatewayProxy (rk , tctx , & gatewayProxy )
116+ config , err := d .getConfigsForGatewayProxy (tctx , & gatewayProxy )
116117 if err != nil {
117118 return err
118119 }
@@ -139,21 +140,12 @@ func (d *adcClient) Update(ctx context.Context, tctx *provider.TranslateContext,
139140 resourceTypes = append (resourceTypes , "service" )
140141 case * gatewayv1.Gateway :
141142 result , err = d .translator .TranslateGateway (tctx , t .DeepCopy ())
142- if err != nil {
143- return err
144- }
145143 resourceTypes = append (resourceTypes , "global_rule" , "ssl" , "plugin_metadata" )
146144 case * networkingv1.Ingress :
147145 result , err = d .translator .TranslateIngress (tctx , t .DeepCopy ())
148- if err != nil {
149- return err
150- }
151146 resourceTypes = append (resourceTypes , "service" , "ssl" )
152147 case * v1alpha1.Consumer :
153148 result , err = d .translator .TranslateConsumerV1alpha1 (tctx , t .DeepCopy ())
154- if err != nil {
155- return err
156- }
157149 resourceTypes = append (resourceTypes , "consumer" )
158150 }
159151 if err != nil {
0 commit comments