Skip to content

Commit

Permalink
Merge pull request #13075 from bparees/backport_phase
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Feb 23, 2017
2 parents 2e2a6d6 + 2a347ee commit 76b2a8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/build/registry/build/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/openshift/origin/pkg/build/api"
"github.com/openshift/origin/pkg/build/api/validation"
buildutil "github.com/openshift/origin/pkg/build/util"
)

// strategy implements behavior for Build objects
Expand Down Expand Up @@ -94,7 +95,13 @@ type detailsStrategy struct {
func (detailsStrategy) PrepareForUpdate(ctx kapi.Context, obj, old runtime.Object) {
newBuild := obj.(*api.Build)
oldBuild := old.(*api.Build)
phase := newBuild.Status.Phase

// ignore phase updates unless the caller is updating the build to
// a completed phase.
phase := oldBuild.Status.Phase
if buildutil.IsBuildComplete(newBuild) {
phase = newBuild.Status.Phase
}
revision := newBuild.Spec.Revision
message := newBuild.Status.Message
reason := newBuild.Status.Reason
Expand Down

0 comments on commit 76b2a8f

Please sign in to comment.