Skip to content

Commit c06dd59

Browse files
committed
fix
1 parent 35f42a5 commit c06dd59

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/provider/adc/adc.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ type Task struct {
5555
func New() (provider.Provider, error) {
5656
return &adcClient{
5757
syncTimeout: config.ControllerConfig.ExecADCTimeout.Duration,
58-
translator: &translator.Translator{},
59-
configs: make(map[provider.ResourceKind]adcConfig),
60-
parentRefs: make(map[provider.ResourceKind][]provider.ResourceKind),
58+
translator: &translator.Translator{},
59+
configs: make(map[provider.ResourceKind]adcConfig),
60+
parentRefs: make(map[provider.ResourceKind][]provider.ResourceKind),
6161
}, nil
6262
}
6363

@@ -230,7 +230,8 @@ func (d *adcClient) sync(ctx context.Context, task Task) error {
230230
}
231231

232232
func (d *adcClient) execADC(ctx context.Context, config adcConfig, args []string) error {
233-
ctxWithTimeout, _ := context.WithTimeout(ctx, config.adc
233+
ctxWithTimeout, cancel := context.WithTimeout(ctx, d.syncTimeout)
234+
defer cancel()
234235
// todo: use adc config
235236
serverAddr := d.ServerAddr
236237
if config.ServerAddr != "" {

0 commit comments

Comments
 (0)