Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittrock committed Jun 28, 2018
1 parent ec5c8fa commit 7cc57ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/book/basics/project_creation_and_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 6 additions & 4 deletions docs/book/basics/simple_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7cc57ec

Please sign in to comment.