Skip to content

Commit

Permalink
Fix missing parameter in hook watch (#235)
Browse files Browse the repository at this point in the history
* fix missing parameter

* Fix missing 1.20 to 1.21 upgrade

* Hold on pointer

* Revert go upgrade
  • Loading branch information
juldrixx committed Sep 12, 2023
1 parent caa0f13 commit d00d009
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit d00d009

Please sign in to comment.