Skip to content

Commit 34f7dbc

Browse files
authored
fix(router): fix wrong option configuration, add script-related options (#3221)
1 parent d568570 commit 34f7dbc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cluster/router/options.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ func WithForce(force bool) Option {
6161

6262
func WithRuntime(runtime bool) Option {
6363
return func(opts *Options) {
64-
opts.Router.Force = &runtime
64+
opts.Router.Runtime = &runtime
6565
}
6666
}
6767

6868
func WithEnabled(enabled bool) Option {
6969
return func(opts *Options) {
70-
opts.Router.Force = &enabled
70+
opts.Router.Enabled = &enabled
7171
}
7272
}
7373

@@ -93,5 +93,16 @@ func WithTags(tags []global.Tag) Option {
9393
return func(opts *Options) {
9494
opts.Router.Tags = tags
9595
}
96+
}
9697

98+
func WithScript(script string) Option {
99+
return func(opts *Options) {
100+
opts.Router.Script = script
101+
}
102+
}
103+
104+
func WithScriptType(scriptType string) Option {
105+
return func(opts *Options) {
106+
opts.Router.ScriptType = scriptType
107+
}
97108
}

0 commit comments

Comments
 (0)