Skip to content

Commit

Permalink
Add comments to watch functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Buddhi Kothalawala authored and Buddhi Kothalawala committed Jul 8, 2019
1 parent d1182b8 commit 299a4f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/siddhiprocess/siddhiprocess_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource Deployments and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand All @@ -105,6 +106,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource Services and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand All @@ -113,6 +115,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource PersistentVolumeClaims and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &corev1.PersistentVolumeClaim{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand All @@ -121,6 +124,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource NatsClusters and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &natsv1alpha2.NatsCluster{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand All @@ -129,6 +133,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource NatsStreamingClusters and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &streamingv1alpha1.NatsStreamingCluster{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand All @@ -137,6 +142,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}

// Watch for changes to secondary resource Pods and requeue the owner SiddhiProcess
err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &siddhiv1alpha2.SiddhiProcess{},
Expand Down

0 comments on commit 299a4f6

Please sign in to comment.