File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 8
8
"time"
9
9
10
10
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
11
+ "github.com/GoogleCloudPlatform/kubernetes/pkg/build"
11
12
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
12
13
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
13
14
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet"
@@ -151,9 +152,26 @@ func startAllInOne() {
151
152
controllerManager .Run (10 * time .Second )
152
153
glog .Infof ("Started Kubernetes Replication Manager" )
153
154
155
+ // initialize build controller
156
+ if env ("BUILD_POD_CLEANUP_ENABLED" , "true" ) == "true" {
157
+ os .Setenv ("BUILD_POD_CLEANUP_ENABLED" , "true" )
158
+ }
159
+ buildController := build .MakeBuildController (kubeClient , "openshift/docker-builder" ,
160
+ env ("DOCKER_REGISTRY_URL" , "" ), "openshift/sti-builder" , 120 )
161
+ buildController .Run (10 * time .Second )
162
+
154
163
select {}
155
164
}
156
165
166
+ func env (key string , defaultValue string ) string {
167
+ val := os .Getenv (key )
168
+ if len (val ) == 0 {
169
+ return defaultValue
170
+ } else {
171
+ return val
172
+ }
173
+ }
174
+
157
175
func getDockerEndpoint (dockerEndpoint string ) string {
158
176
var endpoint string
159
177
if len (dockerEndpoint ) > 0 {
You can’t perform that action at this time.
0 commit comments