forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.go
25 lines (20 loc) · 778 Bytes
/
template.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package controller
import (
"github.com/openshift/origin/pkg/cmd/server/bootstrappolicy"
templatecontroller "github.com/openshift/origin/pkg/template/controller"
)
func RunTemplateInstanceController(ctx ControllerContext) (bool, error) {
saName := bootstrappolicy.InfraTemplateInstanceControllerServiceAccountName
restConfig, err := ctx.ClientBuilder.Config(saName)
if err != nil {
return true, err
}
go templatecontroller.NewTemplateInstanceController(
restConfig,
ctx.ClientBuilder.KubeInternalClientOrDie(saName),
ctx.ClientBuilder.OpenshiftInternalBuildClientOrDie(saName),
ctx.ClientBuilder.OpenshiftInternalTemplateClientOrDie(saName),
ctx.TemplateInformers.Template().InternalVersion().TemplateInstances(),
).Run(5, ctx.Stop)
return true, nil
}