@@ -18,6 +18,7 @@ import (
18
18
"github.com/docker/distribution/reference"
19
19
"github.com/fsouza/go-dockerclient"
20
20
21
+ s2igit "github.com/openshift/source-to-image/pkg/scm/git"
21
22
"github.com/openshift/source-to-image/pkg/util"
22
23
23
24
buildapi "github.com/openshift/origin/pkg/build/apis/build"
@@ -263,6 +264,22 @@ func buildEnv(build *buildapi.Build, sourceInfo *git.SourceInfo) []dockerfile.Ke
263
264
return kv
264
265
}
265
266
267
+ // TODO: remove this shim (required to adapt vendored types)
268
+ func toS2ISourceInfo (sourceInfo * git.SourceInfo ) * s2igit.SourceInfo {
269
+ return & s2igit.SourceInfo {
270
+ Ref : sourceInfo .Ref ,
271
+ CommitID : sourceInfo .CommitID ,
272
+ Date : sourceInfo .Date ,
273
+ AuthorName : sourceInfo .AuthorName ,
274
+ AuthorEmail : sourceInfo .AuthorEmail ,
275
+ CommitterName : sourceInfo .CommitterName ,
276
+ CommitterEmail : sourceInfo .CommitterEmail ,
277
+ Message : sourceInfo .Message ,
278
+ Location : sourceInfo .Location ,
279
+ ContextDir : sourceInfo .ContextDir ,
280
+ }
281
+ }
282
+
266
283
// buildLabels returns a slice of KeyValue pairs in a format that appendLabel can
267
284
// consume.
268
285
func buildLabels (build * buildapi.Build , sourceInfo * git.SourceInfo ) []dockerfile.KeyValue {
@@ -273,7 +290,7 @@ func buildLabels(build *buildapi.Build, sourceInfo *git.SourceInfo) []dockerfile
273
290
if len (build .Spec .Source .ContextDir ) > 0 {
274
291
sourceInfo .ContextDir = build .Spec .Source .ContextDir
275
292
}
276
- labels = util .GenerateLabelsFromSourceInfo (labels , & sourceInfo . SourceInfo , buildapi .DefaultDockerLabelNamespace )
293
+ labels = util .GenerateLabelsFromSourceInfo (labels , toS2ISourceInfo ( sourceInfo ) , buildapi .DefaultDockerLabelNamespace )
277
294
addBuildLabels (labels , build )
278
295
279
296
kv := make ([]dockerfile.KeyValue , 0 , len (labels )+ len (build .Spec .Output .ImageLabels ))
0 commit comments