Skip to content

Commit 89a430b

Browse files
authored
chore: support adc tls verify args (#141)
Signed-off-by: ashing <[email protected]>
1 parent 7e5ab58 commit 89a430b

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

internal/provider/adc/adc.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type adcConfig struct {
4040
Name string
4141
ServerAddr string
4242
Token string
43+
TlsVerify bool
4344
}
4445

4546
type adcClient struct {
@@ -291,7 +292,6 @@ func (d *adcClient) sync(ctx context.Context, task Task) error {
291292
args := []string{
292293
"sync",
293294
"-f", tmpFile.Name(),
294-
"--tls-skip-verify",
295295
}
296296

297297
for k, v := range task.Labels {
@@ -317,9 +317,12 @@ func (d *adcClient) execADC(ctx context.Context, config adcConfig, args []string
317317

318318
ctxWithTimeout, cancel := context.WithTimeout(ctx, d.syncTimeout)
319319
defer cancel()
320-
// todo: use adc config
321320
serverAddr := config.ServerAddr
322321
token := config.Token
322+
tlsVerify := config.TlsVerify
323+
if !tlsVerify {
324+
args = append(args, "--tls-skip-verify")
325+
}
323326

324327
adcEnv := []string{
325328
"ADC_EXPERIMENTAL_FEATURE_FLAGS=remote-state-file,parallel-backend-request",

internal/provider/adc/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func (d *adcClient) getConfigsForGatewayProxy(tctx *provider.TranslateContext, g
4545
ServerAddr: endpoint,
4646
}
4747

48+
if provider.ControlPlane.TlsVerify != nil {
49+
config.TlsVerify = *provider.ControlPlane.TlsVerify
50+
}
51+
4852
if provider.ControlPlane.Auth.Type == v1alpha1.AuthTypeAdminKey && provider.ControlPlane.Auth.AdminKey != nil {
4953
if provider.ControlPlane.Auth.AdminKey.ValueFrom != nil && provider.ControlPlane.Auth.AdminKey.ValueFrom.SecretKeyRef != nil {
5054
secretRef := provider.ControlPlane.Auth.AdminKey.ValueFrom.SecretKeyRef

internal/provider/adc/translator/httproute.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ func (t *Translator) TranslateHTTPRoute(tctx *provider.TranslateContext, httpRou
541541
return result, nil
542542
}
543543

544-
// NOTE: Dashboard not support Vars, matches only support Path, not support Headers, QueryParams
545544
func (t *Translator) translateGatewayHTTPRouteMatch(match *gatewayv1.HTTPRouteMatch) (*adctypes.Route, error) {
546545
route := &adctypes.Route{}
547546

internal/provider/controlplane/translator/httproute.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ func (t *Translator) TranslateHTTPRoute(tctx *provider.TranslateContext, httpRou
373373
return result, nil
374374
}
375375

376-
// NOTE: Dashboard not support Vars, matches only support Path, not support Headers, QueryParams
377376
func (t *Translator) translateGatewayHTTPRouteMatch(match *gatewayv1.HTTPRouteMatch) (*v1.Route, error) {
378377
route := v1.NewDefaultRoute()
379378

0 commit comments

Comments
 (0)