Skip to content

Releases: nolar/kopf

1.29.0rc1

03 Jan 22:36
23fe387
Compare
Choose a tag to compare
1.29.0rc1 Pre-release
Pre-release

BREAKING CHANGES! The major version increase (0.x → 1.x) means that there are changes in the public interface with no backwards compatibility. Pay attention when upgrading — most of them have quick replacements.

Most of these legacies are extremely old and it is highly unlikely that they were used in any existing operators. The DeprecationWarnings were issued for all these features (except namespaces). See #511.

Removed feature Replacement feature
cooldown= option of decorators backoff= option
event kwarg in @kopf.on.event reason kwarg
cause kwarg in handlers use all kwargs directly
kopf.login() sync function @kopf.on.login handlers and async activities
kopf.config module settings kwarg of @kopf.on.startup() handlers
kopf.config.get_pykube_cfg() for patching @kopf.on.login() handlers
kopf.HandlerFatalError kopf.PermanentError
kopf.HandlerRetryError kopf.TemporaryError
kopf.create_tasks() (sync) kopf.spawn_tasks() (async)
kopf.events.event/info/warn/exception() the same directly in the kopf module
None for labels=/annotations= filters kopf.PRESENT (None now raises exceptions)
Positional field in @on.field('group', 'v1', 'plural', 'field') kwarg field='field' instead
Unversioned keys in storages generate v1/v2 keys explicitly
Storages with unprefixed annotations prefix is now mandatory; defaults to kopf.zalando.org/…
@kopf.on.this(…) for sub-handlers @kopf.subhandler(…) (for readability)

Dropped without replacements:

  • Public fields & methods of OperatorRegistry — use it only as an object for the registry= kwarg. #625 #611
  • All internal sub-registries: Resource[Watching|Spawning|Changing]Registry, ActivityRegistry. #625 #611
  • All legacy registries: SimpleRegistry, GlobalRegistry, etc. #625

Deprecated:

  • operator(namespace='…')operator(namespaces=['…']). #600
  • operator(namespace=None)operator(clusterwide=True). #600

New features:

  • Namespace serving:
    • Multiple namespaces: e.g. -n default -n myapp. #500
    • Namespace globs: e.g. --namespace myapp-*,!*-pr-*. #500
    • Namespace precompiled regexps (only in embedded mode). #500
  • Resource serving:
    • Resources specified partially with/without versions: @kopf.on.event('kopf.dev', 'kex'). #500
    • Resources specified by secondary names (short, singular, kind): @kopf.on.event(kind='Pod'). #500
    • Resources specified by minimally sufficient auto-guess names: @kopf.on.event('pods'). #500
    • Handling of whole categories of resources: @kopf.on.event(category='all'). #500
    • Handling of all resources (do not try on real clusters): @kopf.on.event(kopf.EVERYTHING). #500
  • Field filters:
    • Fields' presence/absence filters: e.g. @kopf.on.event(…, field='spec.field', value=kopf.PRESENT). #573
    • Fields' value filters: e.g. @kopf.on.event(…, field='spec.field', value='value'); callbacks are supported. #573
    • Fields' diff filters (only for update): @kopf.on.update(…, field='spec.field', old=1, new=2); callbacks are supported. #573
    • Fields' filters are now applicable to all handlers: creation/update/deletion/resuming, daemons, timers, events. #573
  • Peering behaviour is now configurable via settings. #572

Improvements:

  • The operator's core ("reactor") is full reworked for dynamic detection of resources and namespaces. #600
  • Better identifiers of peers in IPv6 networks: for easier identification. #569
  • Better log messages in change-detecting processing: #605
  • Faster (near-instant) unfreezing when peers are gone/expire. #581
  • More notes on x-kubernetes-preserve-unknown-fields in the docs. #612

Bugfixes:

  • Resources with no uids are now supported too. #596
  • CLI for freezing/resuming was failing due to missing authentication. #568
  • Ignore irrelevant handlers in superseding causes (e.g. deletion-during-creation). #606
  • Fixed configuration of the official Kubernetes library, if used for auth piggybacking. #567
  • Guaranteed finalisation of watchers & workers. #628

Contributor experience:

  • Switched to GitHub Actions for CI. #582 #586
  • API errors are wrapped into our own classes, to prevent abstraction leakage of an HTTP client. #575
  • Async timeouts used in the tests, some asyncio tests are time-limited. #608
  • Stricter typing on resources & namespaces. #623 #624
  • Squashed per-resource registries into combined ones. #622
  • Some other refactorings for code clarity: #577 #576 #578 #597 #598 #609 #610 #626 #627

0.28.3

15 Dec 19:30
d4d09be
Compare
Choose a tag to compare

Enhancements:

  • Renamed @kopf.on.this to @kopf.subhandler for readability. #618

Bugfixes:

  • Fixed the resource discovery in case of parallel requests (improper locks & checks). #615

Internals:

  • Fixed the usage example of kopf.execute() to be asynchronous. #618
  • CI functional tests fixed for ResourceWarnings due to pykube-ng's session left-overs. #619 #608

0.28.2

11 Dec 12:20
c247b68
Compare
Choose a tag to compare

Bugfixes:

  • Fixed superseding of one cause by another (deletion-during-creation/-update/-resume, update-during-resume, etc). #607 #606

0.28.2rc1

10 Dec 20:40
c247b68
Compare
Choose a tag to compare
0.28.2rc1 Pre-release
Pre-release

Bugfixes:

  • Fixed superseding of one cause by another (deletion-during-creation/-update/-resume, update-during-resume, etc). #607 #606

0.28.1

03 Dec 23:12
1c24883
Compare
Choose a tag to compare

Bugfixes:

  • No more false "patching failed with inconsistencies" warning for CRDs with status as a subresource. #588

Internal:

  • Back-ported GitHub Actions for CI tests. #592, originally #582

0.28

08 Oct 07:07
bc2a322
Compare
Choose a tag to compare

General topic: stability, resilience, recoverability, better logging and error handling.

New features:

  • JSON logging with --log-format=json. #544
  • Plain-text logging --log-format=plain. #544

Bugfixes:

  • On-field handlers were triggered for non-existent fields with NoneNone change. #523
  • Sub-handlers' state was not purged, preventing their execution in the future. #517
  • Timers were ticking forever after the resource was deleted (if there were no finalizers). #548
  • Persisted states of executed and then filtered-out handlers were not purged. #557

Resilience improvements:

  • Annotations from other Kopf-based operators are fully ignored to avoid ping-pong effects. #539 #538
  • The operator will force-stop itself by SIGKILL after 10 minutes of attempts to stop gracefully. #543
  • Crash the whole operator on unrecoverable errors in watchers/workers. #509
  • Throttle individual resource processing on unexpected errors. #510
  • Extra exceptions are intercepted and ignored for k8s-event posting. #507
  • Treat client timeouts during watches similar to other API errors. #506
  • Handle all connection errors from the initial streaming request. #512

Experience improvements:

  • Annotations restrictions on key length are reworked to allow longer names (v2/v1 keys). #529
  • Annotations values are now compacted (no spaces) for the better visual outlook. #516
  • Log/warn when the resulting patched object does not match the intended patch. #527
  • Log when the patched object unexpectedly disappeared (e.g. was deleted). #559
  • Log K8s API error explanations from K8s API itself, not from the HTTP client library. #558
  • Filtered-out resources do not create phantom logs & do not get annotated anymore. #545
  • Cluster-scoped objects are logged by their name, without "None" as the namespace. #544
  • Better phrasing for some log messages to avoid confusion. #540
  • Documentation fixes. #530

Internal changes:

  • The first release since the fork. #502 #500 #505 #546
  • CI feedback is sped up from ≈40-50 mins to ≈5 mins per push. #536 #537
  • K3d/K3s is used for CI functional/integration testing; Minikube is for nightly tests. #536 #547
  • K8s versions are updated for CI builds. #501
  • Imports are sorted with isort. #525 #531
  • Added tests for operators' peering. #519
  • Added tests for logging & loggers. #544
  • Get rid of mocks for causes & registries, use normal classes. #521
  • Time-based tests are stabilised (though not fully fixed). #534 #528 #520 #522
  • Asyncio tasks are now named in Python 3.8+, which makes the debugging easier. #542
  • Python 3.9 support. #561

0.27.1

07 Oct 19:32
04efd86
Compare
Choose a tag to compare

Bugfixes:

  • Support Python 3.9 with Kopf's 0.27 codebase and features. #562

0.28rc6

05 Oct 18:27
6831c6a
Compare
Choose a tag to compare
0.28rc6 Pre-release
Pre-release

Experience improvements:

  • Log when the patched object disappears (e.g. is deleted). Omit inconsistency warnings for this. #559

0.28rc5

01 Oct 21:13
1497b77
Compare
Choose a tag to compare
0.28rc5 Pre-release
Pre-release

Experience improvements:

  • K8s API errors contain the explanations from K8s API itself, not from an HTTP client library. #558

0.28rc4

26 Sep 13:40
0e66fda
Compare
Choose a tag to compare
0.28rc4 Pre-release
Pre-release

Bugfixes:

  • Persisted states of executed and then filtered-out handlers were not purged. #557