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
v2.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 toReconciler. In addition, methods:createOrUpdateResourcerenamed toreconciledeleteResourcerenamed tocleanup
- Events are removed from
the
ContextofReconcilermethods . 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. - The
initmethod is extracted fromResourceController/Reconcilerto a separate interface called EventSourceInitializer thatReconcilershould implement in order to register event sources. The method has been renamed toprepareEventSourcesand should now return a list ofEventSourceimplementations that theControllerwill automatically register. See also sample for usage. EventSourceManageris now an internal class that users shouldn’t need to interact with.@Controllerannotation renamed to@ControllerConfiguration- The metrics use
reconcile,cleanupandresourcelabels instead ofcreateOrUpdate,deleteandcr, respectively to match the new logic.
Event Sources
- Addressing resources within event sources (and in the framework internally) is now changed
from
.metadata.uidto a pair of.metadata.nameand optional.metadata.namespaceof resource. Represented byResourceID.
The Event
API is simplified. Now if an event source produces an event it needs to just produce an instance of
this class.
EventSourceis refactored, but the changes are trivial.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.