Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@

# JetBrains IDE config
.idea

# e2e test cruft
kubernetes.tar.gz
kubernetes/
2 changes: 2 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 10 additions & 15 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ import (
"log"
"time"

buildclientset "github.com/knative/build/pkg/client/clientset/versioned"
informers "github.com/knative/build/pkg/client/informers/externalversions"
"github.com/knative/build/pkg/reconciler/build"
"github.com/knative/build/pkg/reconciler/buildtemplate"
"github.com/knative/build/pkg/reconciler/clusterbuildtemplate"
cachingclientset "github.com/knative/caching/pkg/client/clientset/versioned"
cachinginformers "github.com/knative/caching/pkg/client/informers/externalversions"
"github.com/knative/pkg/configmap"
"github.com/knative/pkg/controller"
"github.com/knative/pkg/logging"
"github.com/knative/pkg/logging/logkey"
"github.com/knative/pkg/signals"
Expand All @@ -33,17 +39,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/clientcmd"

// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"

onclusterbuilder "github.com/knative/build/pkg/builder/cluster"
buildclientset "github.com/knative/build/pkg/client/clientset/versioned"
informers "github.com/knative/build/pkg/client/informers/externalversions"
"github.com/knative/build/pkg/controller"
"github.com/knative/build/pkg/reconciler/build"
"github.com/knative/build/pkg/reconciler/buildtemplate"
"github.com/knative/build/pkg/reconciler/clusterbuildtemplate"
)

const (
Expand Down Expand Up @@ -103,12 +98,11 @@ func main() {
buildTemplateInformer := buildInformerFactory.Build().V1alpha1().BuildTemplates()
clusterBuildTemplateInformer := buildInformerFactory.Build().V1alpha1().ClusterBuildTemplates()
imageInformer := cachingInformerFactory.Caching().V1alpha1().Images()

bldr := onclusterbuilder.NewBuilder(kubeClient, kubeInformerFactory, logger)
podInformer := kubeInformerFactory.Core().V1().Pods()

// Build all of our controllers, with the clients constructed above.
controllers := []controller.Interface{
build.NewController(logger, kubeClient, buildClient, buildInformer, buildTemplateInformer, clusterBuildTemplateInformer, bldr),
controllers := []*controller.Impl{
build.NewController(logger, kubeClient, podInformer, buildClient, buildInformer, buildTemplateInformer, clusterBuildTemplateInformer),
clusterbuildtemplate.NewController(logger, kubeClient, buildClient,
cachingClient, clusterBuildTemplateInformer, imageInformer),
buildtemplate.NewController(logger, kubeClient, buildClient,
Expand All @@ -124,6 +118,7 @@ func main() {
buildTemplateInformer.Informer().HasSynced,
clusterBuildTemplateInformer.Informer().HasSynced,
imageInformer.Informer().HasSynced,
podInformer.Informer().HasSynced,
} {
if ok := cache.WaitForCacheSync(stopCh, synced); !ok {
logger.Fatalf("failed to wait for cache at index %v to sync", i)
Expand Down
Loading