fixed healthchecker start even if disabled, simplified label parsing

This commit is contained in:
yusing
2024-11-11 06:34:12 +08:00
parent 2951304647
commit c07f2ed722
11 changed files with 158 additions and 290 deletions

View File

@@ -19,8 +19,6 @@ type Entry interface {
}
func ValidateEntry(m *RawEntry) (Entry, E.Error) {
m.FillMissingFields()
scheme, err := T.NewScheme(m.Scheme)
if err != nil {
return nil, E.From(err)
@@ -36,6 +34,9 @@ func ValidateEntry(m *RawEntry) (Entry, E.Error) {
if errs.HasError() {
return nil, errs.Error()
}
if !UseHealthCheck(entry) && (UseLoadBalance(entry) || UseIdleWatcher(entry)) {
return nil, E.New("healthCheck.disable cannot be true when loadbalancer or idlewatcher is enabled")
}
return entry, nil
}