Skip to content

Commit d7559de

Browse files
Merge pull request #11 from ironcladlou/rev_kubernetes
Integrate with BuildController
2 parents 9427549 + 749fb63 commit d7559de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: pkg/cmd/master/master.go

+18
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"time"
99

1010
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
11+
"github.com/GoogleCloudPlatform/kubernetes/pkg/build"
1112
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
1213
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
1314
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet"
@@ -151,9 +152,26 @@ func startAllInOne() {
151152
controllerManager.Run(10 * time.Second)
152153
glog.Infof("Started Kubernetes Replication Manager")
153154

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+
154163
select {}
155164
}
156165

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+
157175
func getDockerEndpoint(dockerEndpoint string) string {
158176
var endpoint string
159177
if len(dockerEndpoint) > 0 {

0 commit comments

Comments
 (0)