From 37613ff1a7a324a15d3aece023ecec5d3d0dd143 Mon Sep 17 00:00:00 2001 From: Ben Parees Date: Sat, 21 Jan 2017 19:45:09 -0500 Subject: [PATCH] allow source info to be provided as part of config --- pkg/api/types.go | 4 ++++ pkg/build/strategies/sti/sti.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pkg/api/types.go b/pkg/api/types.go index b5dc1ab62..2c400d7a4 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -238,6 +238,10 @@ type Config struct { // must have non-zero length. The labels defined here override generated labels in case // they have the same name. Labels map[string]string + + // SourceInfo provides the info about the source to be built rather than relying + // on the Downloader to retrieve it. + SourceInfo *SourceInfo } // EnvironmentSpec specifies a single environment variable. diff --git a/pkg/build/strategies/sti/sti.go b/pkg/build/strategies/sti/sti.go index e8f94a6bd..dcc233bda 100644 --- a/pkg/build/strategies/sti/sti.go +++ b/pkg/build/strategies/sti/sti.go @@ -348,6 +348,9 @@ func (builder *STI) Prepare(config *api.Config) error { ) return err } + if config.SourceInfo != nil { + builder.sourceInfo = config.SourceInfo + } } // get the scripts