<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Migrations on Java Operator SDK</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/</link><description>Recent content in Migrations on Java Operator SDK</description><generator>Hugo</generator><language>en</language><atom:link href="https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrating from v1 to v2</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v2-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v2-migration/</guid><description>&lt;p&gt;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
v&lt;code&gt;2.0.0&lt;/code&gt; &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/milestone/1"&gt;see milestone on GitHub&lt;/a&gt;
. For a summary and reasoning behind some naming changes
see &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/issues/655"&gt;this issue&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="user-facing-api-changes"&gt;User Facing API Changes&lt;/h2&gt;
&lt;p&gt;The following items are renamed and slightly changed:&lt;/p&gt;</description></item><item><title>Migrating from v2 to v3</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v3-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v3-migration/</guid><description>&lt;p&gt;Version 3 introduces some breaking changes to APIs, however the migration to these changes should be trivial.&lt;/p&gt;
&lt;h2 id="reconciler"&gt;Reconciler&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/67d8e25c26eb92392c6d2a9eb39ea6dddbbfafcc/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java#L16-L16"&gt;&lt;code&gt;Reconciler&lt;/code&gt;&lt;/a&gt;
can throw checked exception (not just runtime exception), and that also can be handled by &lt;code&gt;ErrorStatusHandler&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cleanup&lt;/code&gt; method is extracted from the &lt;code&gt;Reconciler&lt;/code&gt; interface to a
separate &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java"&gt;&lt;code&gt;Cleaner&lt;/code&gt;&lt;/a&gt;
interface. Finalizers only makes sense that the &lt;code&gt;Cleanup&lt;/code&gt; is implemented, from
now finalizer is only added if the &lt;code&gt;Reconciler&lt;/code&gt; implements this interface (or has managed dependent resources
implementing &lt;code&gt;Deleter&lt;/code&gt; interface, see dependent resource docs).&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Context.java#L9-L9"&gt;&lt;code&gt;Context&lt;/code&gt;&lt;/a&gt;
object of &lt;code&gt;Reconciler&lt;/code&gt; now takes the Primary resource as parametrized type: &lt;code&gt;Context&amp;lt;MyCustomResource&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/67d8e25c26eb92392c6d2a9eb39ea6dddbbfafcc/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusHandler.java"&gt;&lt;code&gt;ErrorStatusHandler&lt;/code&gt;&lt;/a&gt;
result changed, it functionally has been extended to now prevent Exception to be retried and handles checked
exceptions as mentioned above.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="event-sources"&gt;Event Sources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Event Sources are now registered with a name. But &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/92bfafd8831e5fb9928663133f037f1bf4783e3e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/EventSourceInitializer.java#L33-L33"&gt;utility method&lt;/a&gt;
is available to make it easy to &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/92bfafd8831e5fb9928663133f037f1bf4783e3e/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java#L51-L52"&gt;migrate&lt;/a&gt;
to a default name.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/92bfafd8831e5fb9928663133f037f1bf4783e3e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java#L75-L75"&gt;InformerEventSource&lt;/a&gt;
constructor changed to reflect additional functionality in a non backwards compatible way. All the configuration
options from the constructor where moved to &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/f6c6d568ea0a098e11beeeded20fe70f9c5bf692/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java"&gt;&lt;code&gt;InformerConfiguration&lt;/code&gt;&lt;/a&gt;
. See sample usage in &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/f6c6d568ea0a098e11beeeded20fe70f9c5bf692/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java#L56-L59"&gt;&lt;code&gt;WebPageReconciler&lt;/code&gt;&lt;/a&gt;
.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PrimaryResourcesRetriever&lt;/code&gt; was renamed to &lt;code&gt;SecondaryToPrimaryMapper&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AssociatedSecondaryResourceIdentifier&lt;/code&gt; was renamed to &lt;code&gt;PrimaryToSecondaryMapper&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getAssociatedResource&lt;/code&gt; is now renamed to get &lt;code&gt;getSecondaryResource&lt;/code&gt; in multiple places&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Migrating from v3 to v3.1</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v3-1-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v3-1-migration/</guid><description>&lt;h2 id="reconciliationmaxinterval-annotation-has-been-renamed-to-maxreconciliationinterval"&gt;ReconciliationMaxInterval Annotation has been renamed to MaxReconciliationInterval&lt;/h2&gt;
&lt;p&gt;Associated methods on both the &lt;code&gt;ControllerConfiguration&lt;/code&gt; class and annotation have also been
renamed accordingly.&lt;/p&gt;
&lt;h2 id="workflows-impact-on-managed-dependent-resources-behavior"&gt;Workflows Impact on Managed Dependent Resources Behavior&lt;/h2&gt;
&lt;p&gt;Version 3.1 comes with a workflow engine that replaces the previous behavior of managed dependent
resources.
See &lt;a href="https://javaoperatorsdk.io/docs/workflows"&gt;Workflows documentation&lt;/a&gt; for further details.
The primary impact after upgrade is a change of the order in which managed dependent resources
are reconciled. They are now reconciled in parallel with optional ordering defined using the
&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/df44917ef81725c10bbcb772ab7b434d511b13b9/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/Dependent.java#L23-L23"&gt;&amp;lsquo;depends_on&amp;rsquo;&lt;/a&gt;
relation to define order between resources if needed. In v3, managed dependent resources were
implicitly reconciled in the order they were defined in.&lt;/p&gt;</description></item><item><title>Migrating from v4.2 to v4.3</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-3-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-3-migration/</guid><description>&lt;h2 id="condition-api-change"&gt;Condition API Change&lt;/h2&gt;
&lt;p&gt;In Workflows the target of the condition was the managed resource itself, not the target dependent resource.
This changed, now the API contains the dependent resource.&lt;/p&gt;
&lt;p&gt;New API:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;public&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;interface&lt;/span&gt; &lt;span style="color:#000"&gt;Condition&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000"&gt;R&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;extends&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;HasMetadata&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;boolean&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;isMet&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;DependentResource&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000"&gt;R&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;dependentResource&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;primary&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;Context&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;context&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;);&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Former API:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;public&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;interface&lt;/span&gt; &lt;span style="color:#000"&gt;Condition&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000"&gt;R&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;extends&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;HasMetadata&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;boolean&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;isMet&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;primary&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;R&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;secondary&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;Context&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000"&gt;P&lt;/span&gt;&lt;span style="color:#ce5c00;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000"&gt;context&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;);&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Migration is trivial. Since the secondary resource can be accessed from the dependent resource. So to access the
secondary
resource just use &lt;code&gt;dependentResource.getSecondaryResource(primary,context)&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Migrating from v4.3 to v4.4</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-4-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-4-migration/</guid><description>&lt;h2 id="api-changes"&gt;API changes&lt;/h2&gt;
&lt;h3 id="configurationservice"&gt;ConfigurationService&lt;/h3&gt;
&lt;p&gt;We have simplified how to deal with the Kubernetes client. Previous versions provided direct
access to underlying aspects of the client&amp;rsquo;s configuration or serialization mechanism. However,
the link between these aspects wasn&amp;rsquo;t as explicit as it should have been. Moreover, the Fabric8
client framework has also revised their serialization architecture in the 6.7 version (see &lt;a href="https://github.com/fabric8io/kubernetes-client/pull/4662"&gt;this
fabric8 pull request&lt;/a&gt; for a discussion of
that change), moving from statically configured serialization to a per-client configuration
(though it&amp;rsquo;s still possible to share serialization mechanism between client instances). As a
consequence, we made the following changes to the &lt;code&gt;ConfigurationService&lt;/code&gt; API:&lt;/p&gt;</description></item><item><title>Migrating from v4.4 to v4.5</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-5-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v4-5-migration/</guid><description>&lt;p&gt;Version 4.5 introduces improvements related to event handling for Dependent Resources, more precisely the
&lt;a href="https://javaoperatorsdk.io/docs/dependent-resources#caching-and-event-handling-in-kubernetesdependentresource"&gt;caching and event handling&lt;/a&gt;
features. As a result the Kubernetes resources managed using
&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/73b1d8db926a24502c3a70da34f6bcac4f66b4eb/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java#L72-L72"&gt;KubernetesDependentResource&lt;/a&gt;
or its subclasses, will add an annotation recording the resource&amp;rsquo;s version whenever JOSDK updates or creates such
resources. This can be turned off using a
&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/73b1d8db926a24502c3a70da34f6bcac4f66b4eb/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L375-L375"&gt;feature flag&lt;/a&gt;
if causes some issues in your use case.&lt;/p&gt;
&lt;p&gt;Using this feature, JOSDK now tracks versions of cached resources. It also uses, by default, that information to prevent
unneeded reconciliations that could occur when, depending on the timing of operations, an outdated resource would happen
to be in the cache. This relies on the fact that versions (as recorded by the &lt;code&gt;metadata.resourceVersion&lt;/code&gt; field) are
currently implemented as monotonically increasing integers (though they should be considered as opaque and their
interpretation discouraged). Note that, while this helps preventing unneeded reconciliations, things would eventually
reach consistency even in the absence of this feature. Also, if this interpreting of the resource versions causes
issues, you can turn the feature off using the
&lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/73b1d8db926a24502c3a70da34f6bcac4f66b4eb/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L390-L390"&gt;following feature flag&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Migrating from v4.7 to v5.0</title><link>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v5-0-migration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://aerben.github.io/josdk-docs-test/v5.0/docs/migration/v5-0-migration/</guid><description>&lt;p&gt;For migration to v5 see &lt;a href="https://aerben.github.io/josdk-docs-test/v5.0/blog/2025/01/06/version-5-released/"&gt;this blogpost&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>