@@ -213,11 +213,12 @@ type ADCServerTask struct {
213213// ADCServerOpts represents the options in ADC Server task
214214type ADCServerOpts struct {
215215 Backend string `json:"backend"`
216- Server string `json:"server"`
216+ Server [] string `json:"server"`
217217 Token string `json:"token"`
218218 LabelSelector map [string ]string `json:"labelSelector,omitempty"`
219219 IncludeResourceType []string `json:"includeResourceType,omitempty"`
220220 TlsSkipVerify * bool `json:"tlsSkipVerify,omitempty"`
221+ CacheKey string `json:"cacheKey"`
221222}
222223
223224// HTTPADCExecutor implements ADCExecutor interface using HTTP calls to ADC Server
@@ -247,7 +248,15 @@ func (e *HTTPADCExecutor) runHTTPSync(ctx context.Context, mode string, config a
247248 Name : config .Name ,
248249 }
249250
250- for _ , addr := range config .ServerAddrs {
251+ serverAddrs := func () []string {
252+ if mode == "apisix-standalone" {
253+ return []string {strings .Join (config .ServerAddrs , "," )}
254+ }
255+ return config .ServerAddrs
256+ }()
257+ log .Debugw ("running http sync" , zap .Strings ("serverAddrs" , serverAddrs ), zap .String ("mode" , mode ))
258+
259+ for _ , addr := range serverAddrs {
251260 if err := e .runHTTPSyncForSingleServer (ctx , addr , mode , config , args ); err != nil {
252261 log .Errorw ("failed to run http sync for server" , zap .String ("server" , addr ), zap .Error (err ))
253262 var execErr types.ADCExecutionServerAddrError
@@ -365,11 +374,12 @@ func (e *HTTPADCExecutor) buildHTTPRequest(ctx context.Context, serverAddr, mode
365374 Task : ADCServerTask {
366375 Opts : ADCServerOpts {
367376 Backend : mode ,
368- Server : serverAddr ,
377+ Server : strings . Split ( serverAddr , "," ) ,
369378 Token : config .Token ,
370379 LabelSelector : labels ,
371380 IncludeResourceType : types ,
372381 TlsSkipVerify : ptr .To (! tlsVerify ),
382+ CacheKey : config .Name ,
373383 },
374384 Config : * resources ,
375385 },
@@ -386,6 +396,7 @@ func (e *HTTPADCExecutor) buildHTTPRequest(ctx context.Context, serverAddr, mode
386396 zap .String ("url" , e .serverURL + "/sync" ),
387397 zap .String ("server" , serverAddr ),
388398 zap .String ("mode" , mode ),
399+ zap .String ("cacheKey" , config .Name ),
389400 zap .Any ("labelSelector" , labels ),
390401 zap .Strings ("includeResourceType" , types ),
391402 zap .Bool ("tlsSkipVerify" , ! tlsVerify ),
0 commit comments