Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing parameter in hook watch #235

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/reconciler/internal/hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func NewDependentResourceWatcher(c controller.Controller, rm meta.RESTMapper, ca
return &dependentResourceWatcher{
controller: c,
restMapper: rm,
cache: cache,
scheme: scheme,
m: sync.Mutex{},
watches: make(map[schema.GroupVersionKind]struct{}),
}
Expand All @@ -52,7 +54,7 @@ type dependentResourceWatcher struct {
controller controller.Controller
restMapper meta.RESTMapper
cache cache.Cache
scheme runtime.Scheme
scheme *runtime.Scheme

m sync.Mutex
watches map[schema.GroupVersionKind]struct{}
Expand Down Expand Up @@ -96,7 +98,7 @@ func (d *dependentResourceWatcher) Exec(owner *unstructured.Unstructured, rel re
}

if useOwnerRef && !manifestutil.HasResourcePolicyKeep(unstructuredObj.GetAnnotations()) { // Setup watch using owner references.
if err := d.controller.Watch(source.Kind(d.cache, unstructuredObj), handler.EnqueueRequestForOwner(&d.scheme, d.restMapper, owner, handler.OnlyControllerOwner()), dependentPredicate); err != nil {
if err := d.controller.Watch(source.Kind(d.cache, unstructuredObj), handler.EnqueueRequestForOwner(d.scheme, d.restMapper, owner, handler.OnlyControllerOwner()), dependentPredicate); err != nil {
return err
}
} else { // Setup watch using annotations.
Expand Down
Loading