Skip to content

Commit

Permalink
Move resource collection logic from migration controller
Browse files Browse the repository at this point in the history
Can be used by other modules to get unstructured objects from a namepsace
and matching label selectors
  • Loading branch information
disrani-px committed May 2, 2019
1 parent 43cb1fd commit 9ddc334
Show file tree
Hide file tree
Showing 10 changed files with 910 additions and 359 deletions.
13 changes: 11 additions & 2 deletions cmd/stork/stork.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/libopenstorage/stork/pkg/migration"
"github.com/libopenstorage/stork/pkg/monitor"
"github.com/libopenstorage/stork/pkg/pvcwatcher"
"github.com/libopenstorage/stork/pkg/resourcecollector"
"github.com/libopenstorage/stork/pkg/rule"
"github.com/libopenstorage/stork/pkg/schedule"
"github.com/libopenstorage/stork/pkg/snapshot"
Expand Down Expand Up @@ -294,11 +295,19 @@ func runStork(d volume.Driver, recorder record.EventRecorder, c *cli.Context) {
}
}

resourceCollector := resourcecollector.ResourceCollector{
Driver: d,
}
if err := resourceCollector.Init(); err != nil {
log.Fatalf("Error initializing ResourceCollector: %v", err)
}

if c.Bool("migration-controller") {
migrationAdminNamespace := c.String("migration-admin-namespace")
migration := migration.Migration{
Driver: d,
Recorder: recorder,
Driver: d,
Recorder: recorder,
ResourceCollector: resourceCollector,
}
if err := migration.Init(migrationAdminNamespace); err != nil {
log.Fatalf("Error initializing migration: %v", err)
Expand Down
Loading

0 comments on commit 9ddc334

Please sign in to comment.