@@ -110,27 +110,27 @@ type detailsStrategy struct {
110
110
}
111
111
112
112
// Prepares a build for update by only allowing an update to build details.
113
- // build details currently consists of: Spec.Revision, Status.Reason, and
113
+ // Build details currently consists of: Spec.Revision, Status.Reason, and
114
114
// Status.Message, all of which are updated from within the build pod
115
115
func (detailsStrategy ) PrepareForUpdate (obj , old runtime.Object ) {
116
116
newBuild := obj .(* api.Build )
117
117
oldBuild := old .(* api.Build )
118
118
revision := newBuild .Spec .Revision
119
- oldReason := oldBuild .Status .Reason
120
- oldMessage := oldBuild .Status .Message
119
+ message := newBuild .Status .Message
120
+ reason := newBuild .Status .Reason
121
121
* newBuild = * oldBuild
122
122
newBuild .Spec .Revision = revision
123
- newBuild .Status .Reason = oldReason
124
- newBuild .Status .Message = oldMessage
123
+ newBuild .Status .Reason = reason
124
+ newBuild .Status .Message = message
125
125
}
126
126
127
127
// Validates that an update is valid by ensuring that no Revision exists and that it's not getting updated to blank
128
128
func (detailsStrategy ) ValidateUpdate (ctx kapi.Context , obj , old runtime.Object ) field.ErrorList {
129
129
newBuild := obj .(* api.Build )
130
130
oldBuild := old .(* api.Build )
131
- errors := field.ErrorList {}
132
131
oldRevision := oldBuild .Spec .Revision
133
132
newRevision := newBuild .Spec .Revision
133
+ errors := field.ErrorList {}
134
134
135
135
if newRevision == nil {
136
136
errors = append (errors , field .Invalid (field .NewPath ("spec" , "revision" ), nil , "cannot set an empty revision in build spec" ))
0 commit comments