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
Purge all deprecated methods and classes for v1.x #511
Conversation
This pull request fixes 1 alert when merging 421e187 into caaf399 - view on LGTM.com fixed alerts:
|
421e187
to
a3c1f66
Compare
This pull request introduces 5 alerts and fixes 1 when merging a3c1f66 into d712db2 - view on LGTM.com new alerts:
fixed alerts:
|
a3c1f66
to
0adabf4
Compare
This pull request introduces 5 alerts when merging 0adabf4 into 7567d71 - view on LGTM.com new alerts:
|
ccbe85d
to
c9233e8
Compare
c9233e8
to
89fc3b6
Compare
89fc3b6
to
72a3276
Compare
This pull request introduces 1 alert when merging 72a3276 into 878a5af - view on LGTM.com new alerts:
|
72a3276
to
3c5aef2
Compare
This pull request fixes 2 alerts when merging 3c5aef2 into 878a5af - view on LGTM.com fixed alerts:
|
Drop all features that were declared deprecated a long time ago. The exact list is below — with the supposed replacements.
cooldown=
option of decorators →backoff=
.event
kwarg in@kopf.on.event
→reason
.cause
kwarg in handlers → use all kwargs directly.kopf.login()
sync function → async activity internally.kopf.config
module →settings
kwarg of@on.startup()
handlers.get_pykube_cfg()
for patching →@on.login()
handlers.HandlerFatalError
→PermanentError
HandlerRetryError
→TemporaryError
kopf.create_tasks()
(sync) →kopf.spawn_tasks()
(async).kopf.events.[event|info|warn|exception]()
→ the same directly inkopf
module.None
forlabels=
/annotations=
filters →kopf.PRESENT
(None now raises exceptions).@on.field('group', 'v1', 'plural', 'field')
→ kwargfield='field'
instead.kopf.zalando.org/…
.@kopf.on.this()
for sub-handlers →@kopf.subhandler()
(for readability)Most of these legacies are extremely old and it is highly unlikely that they were used in any existing operators. In any case, the
DeprecationWarning
s were issued for all these features, so there should be enough time to switch.THIS IS A BREAKING CHANGE. => Major version increase is required.
Unlike #625 (dropping the legacy registries), these features are not difficult to maintain in backwards-compatible mode. However, since #625 is now required for the reactor's refactoring, and therefore the major version has to be increased — it seems like a good idea to also drop all other legacies from the code to make it cleaner.
PREVIOUS DESCRIPTION:
This PR is a preview of what will be dropped from the next major release (1.0) when it happens.
There are no specific dates or estimations or even criteria of readiness for 1.0. But the preparations can be performed now.
All deprecated classes and methods and functions do issue warnings now (
DeprecationWarning
), so the operator developers should pay attention to them and switch to the recommended constructs.This branch is regularly synced with the recent master — to keep the release-1.0-look-ahead code always up to date and tested.
Replaces #316 zalando-incubator/kopf#316