call validate when config update coz apiserver restart (#5564)

Co-authored-by: jinshanwu <jinshanwu@deeproute.ai>
This commit is contained in:
Fritzmomoto
2023-03-03 15:30:39 +08:00
committed by GitHub
parent e6c1c4b7b5
commit f63c371eaf

View File

@@ -118,6 +118,11 @@ func Run(s *options.ServerRunOptions, configCh <-chan apiserverconfig.Config, ct
s.Config = &cfg
ictx, cancelFunc = context.WithCancel(context.TODO())
go func() {
if errs := s.Validate(); len(errs) != 0 {
for _, err := range errs {
errCh <- err
}
}
if err := run(s, ictx); err != nil {
errCh <- err
}