fix: resolve issue with jar upgrade not uploading new jar
Ensure the new jar is properly uploaded during an upgrade process. Previously, the jar was not replaced as expected.
This commit is contained in:
@@ -12,22 +12,29 @@ import (
|
||||
)
|
||||
|
||||
// run the job from savepoint and jarId in managedJob
|
||||
func (job *ManagedJob) run() error {
|
||||
func (job *ManagedJob) run(restoreMode bool) error {
|
||||
var savepointPath string
|
||||
if job.def.Status.LastSavepointPath == nil {
|
||||
pkg.Logger.Error("[managed-job] [restore]", zap.Error(v1alpha1.ErrNoSavepointPath))
|
||||
//return v1alpha1.ErrNoSavepointPath
|
||||
if restoreMode {
|
||||
return v1alpha1.ErrNoSavepointPath
|
||||
}
|
||||
} else {
|
||||
savepointPath = *job.def.Status.LastSavepointPath
|
||||
}
|
||||
|
||||
pkg.Logger.Info("[managed-job] [restore] restoring job", zap.String("name", job.def.GetName()), zap.String("savepointPath", savepointPath))
|
||||
pkg.Logger.Info(
|
||||
"[managed-job] [restore] starting job...",
|
||||
zap.Bool("restoreMode", restoreMode),
|
||||
zap.String("name", job.def.GetName()),
|
||||
zap.String("savepointPath", savepointPath),
|
||||
)
|
||||
var jobId *string
|
||||
for {
|
||||
shouldUpload := false
|
||||
if job.def.Status.JarId == nil {
|
||||
err := v1alpha1.ErrNoJarId
|
||||
pkg.Logger.Error("[managed-job] [run]", zap.Error(err))
|
||||
pkg.Logger.Warn("[managed-job] [run] will upload new jar...", zap.Error(err))
|
||||
shouldUpload = true
|
||||
} else {
|
||||
runJarResp, err := job.client.RunJar(api.RunOpts{
|
||||
|
||||
Reference in New Issue
Block a user