volcano
volcano copied to clipboard
remove useless job valid check
because ssn.Tiers is not initiated and plugins has not OnSessionOpen() to register callback to jobValidFns
in openSession() function, ssn.Tiers is not initiated, it's nil, and the plugins has not OnSessionOpen() to register callback to jobValidFns, tier.jobValidFns map is empty. so it's no need to check job valid at session initiation stage.
func (ssn *Session) JobValid(obj interface{}) *api.ValidateResult {
for _, tier := range ssn.Tiers {
for _, plugin := range tier.Plugins {
jrf, found := ssn.jobValidFns[plugin.Name]
if !found {
continue
}
if vr := jrf(obj); vr != nil && !vr.Pass {
return vr
}
}
}
return nil
}