spotify/flink-on-k8s-operator

FromSavepoint not work at first time

lppsuixn opened this issue · 0 comments

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