From 7cc57ec11cdc8e62ce8bc073914f4784d3fd4c4d Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Thu, 28 Jun 2018 11:00:13 -0700 Subject: [PATCH] Address PR comments --- docs/book/basics/project_creation_and_structure.md | 2 +- docs/book/basics/simple_controller.md | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/book/basics/project_creation_and_structure.md b/docs/book/basics/project_creation_and_structure.md index 00bde76f66..bdcf5e3398 100644 --- a/docs/book/basics/project_creation_and_structure.md +++ b/docs/book/basics/project_creation_and_structure.md @@ -27,7 +27,7 @@ The `pkg/apis` package is scaffolded automatically by `kubebuilder create api` w The `pkg/controller/...` packages contain the Controller implementations. Users edit the `*_controller.go` files under this directory to implement their Controllers. -The `pkg/apis` package is scaffolded automatically by `kubebuilder create api` when creating a Controller. +The `pkg/controller` package is scaffolded automatically by `kubebuilder create api` when creating a Controller. ## Additional directories and files diff --git a/docs/book/basics/simple_controller.md b/docs/book/basics/simple_controller.md index a92fc59aee..4f6ca6a2bb 100644 --- a/docs/book/basics/simple_controller.md +++ b/docs/book/basics/simple_controller.md @@ -46,7 +46,7 @@ Sources Handlers - To enqueue a Reconcile for the object in the event use a `handler.EnqueueRequestForObject` -- To enqueue a Reconcile for the object that created the object in the event use a `handler.EnqueueRequestForOwner` +- To enqueue a Reconcile for the owner object that created the object in the event use a `handler.EnqueueRequestForOwner` with the type of the owner e.g. `&handler.EnqueueRequestForOwner{OwnerType: &appsv1.Deployment{}, IsController: true}` - To enqueue Reconcile requests for an arbitrary collection of objects in response to the event, use a `handler.EnqueueRequestsFromMapFunc`. @@ -84,7 +84,9 @@ func Add(mgr manager.Manager) error ( } // Watch for changes to ContainerSet - err = c.Watch(&source.Kind{Type: &crewv1.FirstMate{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch( + &source.Kind{Type:&workloadsv1beta1.ContainerSet{}}, + &handler.EnqueueRequestForObject{}) if err != nil { return err } @@ -94,7 +96,7 @@ func Add(mgr manager.Manager) error ( &source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{ IsController: true, - OwnerType: &crewv1.FirstMate{}, + OwnerType: &workloadsv1beta1.ContainerSet{}, }) if err != nil { return err @@ -148,7 +150,7 @@ var _ reconcile.Reconciler = &ContainerSetController{} func (r *ContainerSetController) Reconcile(request reconcile.Request) ( reconcile.Result, error) { // Read the ContainerSet - cs := &v1alpha1.ContainerSet{} + cs := &workloadv1beta1.ContainerSet{} err := r.client.Get(context.TODO(), request.NamespacedName, cs) // Handle deleted or error case