@@ -14,6 +14,7 @@ import (
14
14
docker "github.com/fsouza/go-dockerclient"
15
15
16
16
kapi "k8s.io/kubernetes/pkg/api"
17
+ utilruntime "k8s.io/kubernetes/pkg/util/runtime"
17
18
18
19
s2iapi "github.com/openshift/source-to-image/pkg/api"
19
20
"github.com/openshift/source-to-image/pkg/tar"
@@ -73,7 +74,7 @@ func (d *DockerBuilder) Build() error {
73
74
d .build .Status .Reason = api .StatusReasonFetchSourceFailed
74
75
d .build .Status .Message = api .StatusMessageFetchSourceFailed
75
76
if updateErr := retryBuildStatusUpdate (d .build , d .client , nil ); updateErr != nil {
76
- glog . V ( 0 ). Infof ("error: An error occured while updating the build status: %v" , updateErr )
77
+ utilruntime . HandleError ( fmt . Errorf ("error: An error occured while updating the build status: %v" , updateErr ) )
77
78
}
78
79
return err
79
80
}
@@ -82,7 +83,7 @@ func (d *DockerBuilder) Build() error {
82
83
glog .V (4 ).Infof ("Setting build revision with details %#v" , sourceInfo )
83
84
revision := updateBuildRevision (d .build , sourceInfo )
84
85
if updateErr := retryBuildStatusUpdate (d .build , d .client , revision ); updateErr != nil {
85
- glog . V ( 0 ). Infof ("error: An error occured while updating the build status: %v" , updateErr )
86
+ utilruntime . HandleError ( fmt . Errorf ("error: An error occured while updating the build status: %v" , updateErr ) )
86
87
}
87
88
}
88
89
if err = d .addBuildParameters (buildDir ); err != nil {
@@ -126,7 +127,7 @@ func (d *DockerBuilder) Build() error {
126
127
glog .V (0 ).Infof ("\n Pulling image %s ..." , imageName )
127
128
if err = pullImage (d .dockerClient , imageName , pullAuthConfig ); err != nil {
128
129
if updateErr := retryBuildStatusUpdate (d .build , d .client , nil ); updateErr != nil {
129
- glog . V ( 0 ). Infof ("error: An error occured while updating the build status: %v" , updateErr )
130
+ utilruntime . HandleError ( fmt . Errorf ("error: An error occured while updating the build status: %v" , updateErr ) )
130
131
}
131
132
return fmt .Errorf ("failed to pull image: %v" , err )
132
133
}
@@ -140,7 +141,7 @@ func (d *DockerBuilder) Build() error {
140
141
cname := containerName ("docker" , d .build .Name , d .build .Namespace , "post-commit" )
141
142
if err := execPostCommitHook (d .dockerClient , d .build .Spec .PostCommit , buildTag , cname ); err != nil {
142
143
if updateErr := retryBuildStatusUpdate (d .build , d .client , nil ); updateErr != nil {
143
- glog . V ( 0 ). Infof ("error: An error occured while updating the build status: %v" , updateErr )
144
+ utilruntime . HandleError ( fmt . Errorf ("error: An error occured while updating the build status: %v" , updateErr ) )
144
145
}
145
146
return err
146
147
}
@@ -167,7 +168,7 @@ func (d *DockerBuilder) Build() error {
167
168
glog .V (0 ).Infof ("\n Pushing image %s ..." , pushTag )
168
169
if err := pushImage (d .dockerClient , pushTag , pushAuthConfig ); err != nil {
169
170
if updateErr := retryBuildStatusUpdate (d .build , d .client , nil ); updateErr != nil {
170
- glog . V ( 0 ). Infof ("error: An error occured while updating the build status: %v" , updateErr )
171
+ utilruntime . HandleError ( fmt . Errorf ("error: An error occured while updating the build status: %v" , updateErr ) )
171
172
}
172
173
return reportPushFailure (err , authPresent , pushAuthConfig )
173
174
}
0 commit comments