Migrating from v1 to v2 #
Version 2 of the framework introduces improvements, features and breaking changes for the APIs both
internal and user facing ones. The migration should be however trivial in most of the cases. For
detailed overview of all major issues until the release of
2.0.0 see milestone on GitHub
. For a summary and reasoning behind some naming changes
see this issue
User Facing API Changes #
The following items are renamed and slightly changed:
ResourceControllerinterface is renamed to
Reconciler. In addition, methods:
- Events are removed from
Reconcilermethods . The rationale behind this, is that there is a consensus now on the pattern that the events should not be used to implement a reconciliation logic.
initmethod is extracted from
Reconcilerto a separate interface called EventSourceInitializer that
Reconcilershould implement in order to register event sources. The method has been renamed to
prepareEventSourcesand should now return a list of
EventSourceimplementations that the
Controllerwill automatically register. See also sample for usage.
EventSourceManageris now an internal class that users shouldn’t need to interact with.
@Controllerannotation renamed to
- The metrics use
resourcelabels instead of
cr, respectively to match the new logic.
Event Sources #
- Addressing resources within event sources (and in the framework internally) is now changed
.metadata.uidto a pair of
.metadata.namespaceof resource. Represented by
API is simplified. Now if an event source produces an event it needs to just produce an instance of
EventSourceis refactored, but the changes are trivial.