Skip to content

Commit 1488899

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 4d49411 commit 1488899

File tree

6 files changed

+21
-28
lines changed

6 files changed

+21
-28
lines changed

internal/controller/config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ func NewDefaultConfig() *Config {
5454
Type: ProviderTypeAPI7EE,
5555
SyncPeriod: types.TimeDuration{Duration: 0},
5656
InitSyncDelay: types.TimeDuration{Duration: 20 * time.Minute},
57-
ADCServerURL: "http://127.0.0.1:3000",
58-
UseADCServer: true,
5957
},
6058
}
6159
}

internal/controller/config/types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,4 @@ type ProviderConfig struct {
8484
Type ProviderType `json:"type" yaml:"type"`
8585
SyncPeriod types.TimeDuration `json:"sync_period" yaml:"sync_period"`
8686
InitSyncDelay types.TimeDuration `json:"init_sync_delay" yaml:"init_sync_delay"`
87-
ADCServerURL string `json:"adc_server_url,omitempty" yaml:"adc_server_url,omitempty"`
88-
UseADCServer bool `json:"use_adc_server,omitempty" yaml:"use_adc_server,omitempty"`
8987
}

internal/manager/run.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ func Run(ctx context.Context, logger logr.Logger) error {
173173
SyncPeriod: config.ControllerConfig.ProviderConfig.SyncPeriod.Duration,
174174
InitSyncDelay: config.ControllerConfig.ProviderConfig.InitSyncDelay.Duration,
175175
BackendMode: string(config.ControllerConfig.ProviderConfig.Type),
176-
ADCServerURL: config.ControllerConfig.ProviderConfig.ADCServerURL,
177-
UseADCServer: config.ControllerConfig.ProviderConfig.UseADCServer,
178176
})
179177
if err != nil {
180178
setupLog.Error(err, "unable to create provider")

internal/provider/adc/adc.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,8 @@ func New(updater status.Updater, readier readiness.ReadinessManager, opts ...Opt
115115
o := Options{}
116116
o.ApplyOptions(opts)
117117

118-
// Choose executor based on configuration
119-
var executor ADCExecutor
120-
if o.UseADCServer && o.ADCServerURL != "" {
121-
executor = NewHTTPADCExecutor(o.ADCServerURL)
122-
log.Infow("using HTTP ADC Executor", zap.String("server_url", o.ADCServerURL))
123-
} else {
124-
executor = &DefaultADCExecutor{}
125-
log.Infow("using default CLI ADC Executor")
126-
}
118+
executor := NewHTTPADCExecutor("http://127.0.0.1:3000")
119+
log.Infow("using HTTP ADC Executor", zap.String("server_url", "http://127.0.0.1:3000"))
127120

128121
return &adcClient{
129122
Options: o,

internal/provider/adc/options.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ type Options struct {
2828
SyncPeriod time.Duration
2929
InitSyncDelay time.Duration
3030
BackendMode string
31-
ADCServerURL string
32-
UseADCServer bool
3331
}
3432

3533
func (o *Options) ApplyToList(lo *Options) {
@@ -45,12 +43,6 @@ func (o *Options) ApplyToList(lo *Options) {
4543
if o.BackendMode != "" {
4644
lo.BackendMode = o.BackendMode
4745
}
48-
if o.ADCServerURL != "" {
49-
lo.ADCServerURL = o.ADCServerURL
50-
}
51-
if o.UseADCServer {
52-
lo.UseADCServer = o.UseADCServer
53-
}
5446
}
5547

5648
func (o *Options) ApplyOptions(opts []Option) *Options {

test/e2e/framework/manifests/ingress.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,19 +434,33 @@ spec:
434434
args:
435435
- "server"
436436
- "--listen"
437-
- "http://0.0.0.0:3000"
437+
- "http://127.0.0.1:3000"
438438
ports:
439439
- name: http
440440
containerPort: 3000
441441
protocol: TCP
442442
livenessProbe:
443-
tcpSocket:
444-
port: 3000
443+
exec:
444+
command:
445+
- node
446+
- -e
447+
- >
448+
const s=require('net')
449+
.connect({host:"127.0.0.1",port:3000},
450+
()=>{s.end();process.exit(0);});
451+
s.on("error",()=>process.exit(1));
445452
initialDelaySeconds: 10
446453
periodSeconds: 10
447454
readinessProbe:
448-
tcpSocket:
449-
port: 3000
455+
exec:
456+
command:
457+
- node
458+
- -e
459+
- >
460+
const s=require('net')
461+
.connect({host:"127.0.0.1",port:3000},
462+
()=>{s.end();process.exit(0);});
463+
s.on("error",()=>process.exit(1));
450464
initialDelaySeconds: 5
451465
periodSeconds: 5
452466
securityContext:

0 commit comments

Comments
 (0)