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

Commit

Permalink
dd
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Jun 26, 2019
1 parent 4889ef9 commit d2a2b48
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/controller/mobilesecurityservicebackup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,26 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// PersistenceVolume
// Watch CronJob
if err := watchCronJob(c); err != nil {
return err
}

// Watch watchSecret
if err := watchSecret(c); err != nil {
return err
}

// Watch Pod
if err := watchPod(c); err != nil {
return err
}

// Watch Service
if err := watchService(c); err != nil {
return err
}

return nil
}

Expand Down
16 changes: 16 additions & 0 deletions pkg/controller/mobilesecurityservicebackup/watches.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ func watchSecret(c controller.Controller) error {
})
return err
}

func watchPod(c controller.Controller) error {
err := c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &mobilesecurityservicev1alpha1.MobileSecurityServiceDB{},
})
return err
}

func watchService(c controller.Controller) error {
err := c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &mobilesecurityservicev1alpha1.MobileSecurityServiceDB{},
})
return err
}

0 comments on commit d2a2b48

Please sign in to comment.