@@ -46,6 +46,7 @@ type YurtManagerOptions struct {
46
46
GatewayDNSController * GatewayDNSControllerOptions
47
47
GatewayInternalSvcController * GatewayInternalSvcControllerOptions
48
48
GatewayPublicSvcController * GatewayPublicSvcControllerOptions
49
+ HubLeaderController * HubLeaderControllerOptions
49
50
}
50
51
51
52
// NewYurtManagerOptions creates a new YurtManagerOptions with a default config.
@@ -73,6 +74,7 @@ func NewYurtManagerOptions() (*YurtManagerOptions, error) {
73
74
GatewayDNSController : NewGatewayDNSControllerOptions (),
74
75
GatewayInternalSvcController : NewGatewayInternalSvcControllerOptions (),
75
76
GatewayPublicSvcController : NewGatewayPublicSvcControllerOptions (),
77
+ HubLeaderController : NewHubLeaderControllerOptions (),
76
78
}
77
79
78
80
return & s , nil
@@ -101,6 +103,7 @@ func (y *YurtManagerOptions) Flags(allControllers, disabledByDefaultControllers
101
103
y .GatewayDNSController .AddFlags (fss .FlagSet ("gatewaydns controller" ))
102
104
y .GatewayInternalSvcController .AddFlags (fss .FlagSet ("gatewayinternalsvc controller" ))
103
105
y .GatewayPublicSvcController .AddFlags (fss .FlagSet ("gatewaypublicsvc controller" ))
106
+ y .HubLeaderController .AddFlags (fss .FlagSet ("hubleader controller" ))
104
107
return fss
105
108
}
106
109
@@ -128,6 +131,7 @@ func (y *YurtManagerOptions) Validate(allControllers []string, controllerAliases
128
131
errs = append (errs , y .GatewayDNSController .Validate ()... )
129
132
errs = append (errs , y .GatewayInternalSvcController .Validate ()... )
130
133
errs = append (errs , y .GatewayPublicSvcController .Validate ()... )
134
+ errs = append (errs , y .HubLeaderController .Validate ()... )
131
135
return utilerrors .NewAggregate (errs )
132
136
}
133
137
@@ -196,11 +200,17 @@ func (y *YurtManagerOptions) ApplyTo(c *config.Config, controllerAliases map[str
196
200
if err := y .GatewayPublicSvcController .ApplyTo (& c .ComponentConfig .GatewayPublicSvcController ); err != nil {
197
201
return err
198
202
}
203
+ if err := y .HubLeaderController .ApplyTo (& c .ComponentConfig .HubLeaderController ); err != nil {
204
+ return err
205
+ }
199
206
return nil
200
207
}
201
208
202
209
// Config return a yurt-manager config objective
203
- func (y * YurtManagerOptions ) Config (allControllers []string , controllerAliases map [string ]string ) (* config.Config , error ) {
210
+ func (y * YurtManagerOptions ) Config (
211
+ allControllers []string ,
212
+ controllerAliases map [string ]string ,
213
+ ) (* config.Config , error ) {
204
214
if err := y .Validate (allControllers , controllerAliases ); err != nil {
205
215
return nil , err
206
216
}
0 commit comments