Skip to content

Commit

Permalink
Migrate TPR to CRD (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadlil authored and tamalsaha committed Aug 29, 2017
1 parent 91f678f commit 6a55694
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"github.com/appscode/stash/pkg/analytics"
"github.com/appscode/stash/pkg/controller"
"github.com/appscode/stash/pkg/docker"
"github.com/appscode/stash/pkg/migrator"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
)
Expand Down Expand Up @@ -57,13 +59,18 @@ func NewCmdRun(version string) *cobra.Command {
}
kubeClient = clientset.NewForConfigOrDie(config)
stashClient = scs.NewForConfigOrDie(config)
crdClient := apiextensionsclient.NewForConfigOrDie(config)

ctrl := controller.New(kubeClient, stashClient, tag)
ctrl := controller.New(kubeClient, crdClient, stashClient, tag)
err = ctrl.Setup()
if err != nil {
log.Fatalln(err)
}

if err = migrator.NewMigrator(kubeClient, crdClient).RunMigration(); err != nil {
log.Fatalln(err)
}

log.Infoln("Starting operator...")
ctrl.Run()

Expand Down

0 comments on commit 6a55694

Please sign in to comment.