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:
ResourceController
interface is renamed toReconciler
. In addition, methods:createOrUpdateResource
renamed toreconcile
deleteResource
renamed tocleanup
- Events are removed from
the
Context
ofReconciler
methods . 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
init
method is extracted fromResourceController
/Reconciler
to a separate interface called EventSourceInitializer thatReconciler
should implement in order to register event sources. The method has been renamed toprepareEventSources
and should now return a list ofEventSource
implementations that theController
will automatically register. See also sample for usage. EventSourceManager
is now an internal class that users shouldn’t need to interact with.@Controller
annotation renamed to@ControllerConfiguration
- The metrics use
reconcile
,cleanup
andresource
labels instead ofcreateOrUpdate
,delete
andcr
, respectively to match the new logic.
Event Sources
- Addressing resources within event sources (and in the framework internally) is now changed
from
.metadata.uid
to a pair of.metadata.name
and optional.metadata.namespace
of 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.
EventSource
is 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.