Skip to content

Commit

Permalink
Make DevWorkspace controller own DevWorkspaceTemplates
Browse files Browse the repository at this point in the history
Configure the DevWorkspace controller as an owner of
DevWorkspaceTemplates, in order to trigger reconciles when
DevWorkspaceTemplates owned by DevWorkspaces are updated.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
  • Loading branch information
amisevsk committed Jan 15, 2021
1 parent 71f0458 commit b0b9c5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/workspace/devworkspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ func (r *DevWorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
// TODO: Set up indexing https://book.kubebuilder.io/cronjob-tutorial/controller-implementation.html#setup
return ctrl.NewControllerManagedBy(mgr).
For(&devworkspace.DevWorkspace{}).
// List DevWorkspaceTemplates as owned to enable updating workspaces when templates
// are changed; this should be moved to whichever controller is responsible for flattening
// DevWorkspaces
Owns(&devworkspace.DevWorkspaceTemplate{}).
Owns(&appsv1.Deployment{}).
Owns(&batchv1.Job{}).
Owns(&controllerv1alpha1.Component{}).
Expand Down

0 comments on commit b0b9c5d

Please sign in to comment.