Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FromSavepoint not work at first time #389

Closed
lppsuixn opened this issue May 5, 2022 · 0 comments · Fixed by #390
Closed

FromSavepoint not work at first time #389

lppsuixn opened this issue May 5, 2022 · 0 comments · Fixed by #390

Comments

@lppsuixn
Copy link
Contributor

lppsuixn commented May 5, 2022

Hi,I found FromSavepoint not work at first time.because jobStatus is not nil

var fromSavepoint = convertFromSavepoint(jobSpec, status.Components.Job, &status.Revision)
func convertFromSavepoint(jobSpec *v1beta1.JobSpec, jobStatus *v1beta1.JobStatus, revision *v1beta1.RevisionStatus) *string {
	switch {
	// Creating for the first time
	case jobStatus == nil:
		if !util.IsBlank(jobSpec.FromSavepoint) {
			return jobSpec.FromSavepoint
		}
		return nil
	// Updating with FromSavepoint provided
	case revision.IsUpdateTriggered() && !util.IsBlank(jobSpec.FromSavepoint):
		return jobSpec.FromSavepoint
	// Latest savepoint
	case jobStatus.SavepointLocation != "":
		return &jobStatus.SavepointLocation
	// The savepoint from which current job was restored
	case jobStatus.FromSavepoint != "":
		return &jobStatus.FromSavepoint
	}
	return nil
}

it also was created at the fitst time.eg
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant