Skip to content

Commit

Permalink
Merge pull request #962 from yastij/automated-cherry-pick-of-#946-ups…
Browse files Browse the repository at this point in the history
…tream-release-0.6

Automated cherry pick of #946: re-apply the conccurent clones fix
  • Loading branch information
k8s-ci-robot authored Jul 10, 2020
2 parents 548cbca + 9e4f8a4 commit 6c7ba29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 0 additions & 7 deletions controllers/vspherevm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,6 @@ func (r vmReconciler) reconcileNormal(ctx *context.VMContext) (reconcile.Result,
return reconcile.Result{}, errors.Errorf("bios uuid is empty while VM is ready")
}

// patch the vsphereVM early to ensure that the task is
// reflected in the status right away, this avoid situations
// of concurrent clones
if err := ctx.Patch(); err != nil {
ctx.Logger.Error(err, "patch failed", "vspherevm", ctx.VSphereVM)
}

// Update the VSphereVM's network status.
r.reconcileNetwork(ctx, vm)

Expand Down
6 changes: 6 additions & 0 deletions pkg/services/govmomi/vcenter/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ func Clone(ctx *context.VMContext, bootstrapData []byte) error {

ctx.VSphereVM.Status.TaskRef = task.Reference().Value

// patch the vsphereVM early to ensure that the task is
// reflected in the status right away, this avoid situations
// of concurrent clones
if err := ctx.Patch(); err != nil {
ctx.Logger.Error(err, "patch failed", "vspherevm", ctx.VSphereVM)
}
return nil
}

Expand Down

0 comments on commit 6c7ba29

Please sign in to comment.