We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A pull request by nolar at 2020-03-12 08:46:02+00:00 Original URL: zalando-incubator/kopf#328 Merged by nolar at 2020-03-13 08:33:12+00:00
Add filtering callbacks for individual labels/annotations, similar to the whole-object when= filtering callback.
when=
This is a little separate follow-up for #327:
Why not make callback filters with arbitrary logic for specific labels/annotations?
Just a little feature, which combines the two already existing features:
import kopf def check_marker(value, spec, **_): return value is not None and value == spec.get('field') @kopf.on.create('zalando.org', 'v1', 'kopfexamples', annotations={'some-marker': check_marker}) def kex_created(**_): pass
The value is either a str, or None for an absent label/annotation. The callback is called always.
value
str
None
The kwargs are the same as for the handler or a when= callback.
Issues: #98
Related: #258
CONTRIBUTORS.txt
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What do these changes do?
Add filtering callbacks for individual labels/annotations, similar to the whole-object
when=
filtering callback.Description
This is a little separate follow-up for #327:
Why not make callback filters with arbitrary logic for specific labels/annotations?
Just a little feature, which combines the two already existing features:
The
value
is either astr
, orNone
for an absent label/annotation. The callback is called always.The kwargs are the same as for the handler or a
when=
callback.Issues/PRs
Type of changes
Checklist
CONTRIBUTORS.txt
The text was updated successfully, but these errors were encountered: