Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Align the subhadlers' filters with the same of other handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
nolar committed Feb 20, 2020
1 parent 3a41cfe commit 197856e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kopf/on.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ def this( # lgtm[py/similar-function]
backoff: Optional[float] = None,
cooldown: Optional[float] = None, # deprecated, use `backoff`
registry: Optional[registries.ResourceChangingRegistry] = None,
labels: Optional[bodies.Labels] = None,
annotations: Optional[bodies.Annotations] = None,
when: Optional[callbacks.WhenHandlerFn] = None,
) -> ResourceHandlerDecorator:
"""
``@kopf.on.this()`` decorator for the dynamically generated sub-handlers.
Expand Down Expand Up @@ -351,6 +354,7 @@ def decorator(fn: callbacks.ResourceHandlerFn) -> callbacks.ResourceHandlerFn:
handler = handlers.ResourceHandler(
fn=fn, id=real_id, field=None,
errors=errors, timeout=timeout, retries=retries, backoff=backoff, cooldown=cooldown,
labels=labels, annotations=annotations, when=when,
reason=None,
)
real_registry.append(handler)
Expand All @@ -368,6 +372,9 @@ def register( # lgtm[py/similar-function]
backoff: Optional[float] = None,
cooldown: Optional[float] = None, # deprecated, use `backoff`
registry: Optional[registries.ResourceChangingRegistry] = None,
labels: Optional[bodies.Labels] = None,
annotations: Optional[bodies.Annotations] = None,
when: Optional[callbacks.WhenHandlerFn] = None,
) -> callbacks.ResourceHandlerFn:
"""
Register a function as a sub-handler of the currently executed handler.
Expand Down Expand Up @@ -396,5 +403,6 @@ def create_single_task(task=task, **_):
decorator = this(
id=id, registry=registry,
errors=errors, timeout=timeout, retries=retries, backoff=backoff, cooldown=cooldown,
labels=labels, annotations=annotations, when=when,
)
return decorator(fn)

0 comments on commit 197856e

Please sign in to comment.