Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Migrate to reconciler pattern for Build (#446)
Browse files Browse the repository at this point in the history
* Move controller -> reconciler

* Fix tests

* update-codegen

* now with updated dep-collector

* Reverse IsDone condition

* Remove another indentation
  • Loading branch information
imjasonh authored and knative-prow-robot committed Oct 27, 2018
1 parent f7397a3 commit e9f5b24
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 2,142 deletions.
13 changes: 1 addition & 12 deletions Gopkg.lock

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

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

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/logging"
"github.com/knative/pkg/logging/logkey"
"github.com/knative/pkg/signals"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
kubeinformers "k8s.io/client-go/informers"
Expand All @@ -32,20 +38,12 @@ import (
// _ "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"
buildctrl "github.com/knative/build/pkg/controller/build"
"github.com/knative/build/pkg/reconciler/build"
"github.com/knative/build/pkg/reconciler/buildtemplate"
"github.com/knative/build/pkg/reconciler/clusterbuildtemplate"

buildclientset "github.com/knative/build/pkg/client/clientset/versioned"
informers "github.com/knative/build/pkg/client/informers/externalversions"
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/logging"
"github.com/knative/pkg/logging/logkey"
"github.com/knative/pkg/signals"
)

const (
Expand Down Expand Up @@ -110,11 +108,7 @@ func main() {

// Build all of our controllers, with the clients constructed above.
controllers := []controller.Interface{
// TODO(mattmoor): Move the Build controller logic into pkg/reconciler/build
buildctrl.NewController(bldr, kubeClient, buildClient,
kubeInformerFactory, buildInformerFactory, logger),

build.NewController(logger, kubeClient, buildClient, buildInformer),
build.NewController(logger, kubeClient, buildClient, buildInformer, buildTemplateInformer, clusterBuildTemplateInformer, bldr),
clusterbuildtemplate.NewController(logger, kubeClient, buildClient,
cachingClient, clusterBuildTemplateInformer, imageInformer),
buildtemplate.NewController(logger, kubeClient, buildClient,
Expand Down
Loading

0 comments on commit e9f5b24

Please sign in to comment.