volcano icon indicating copy to clipboard operation
volcano copied to clipboard

remove useless job valid check

Open lx1036 opened this issue 1 year ago • 3 comments

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
}

lx1036 avatar Aug 05 '24 13:08 lx1036

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign hwdef You can assign the PR to them by writing /assign @hwdef in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

volcano-sh-bot avatar Aug 05 '24 13:08 volcano-sh-bot

Can't just remove it.

lowang-bh avatar Aug 06 '24 06:08 lowang-bh

/hold

lowang-bh avatar Aug 06 '24 06:08 lowang-bh

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Feb 01 '25 01:02 stale[bot]