You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 322d9bc
Browse filesBrowse the repository at this point in the historyBrowse files
in [related integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/workflow/orderedmanageddependent/ConfigMapDependentResource2.java)
532
532
.
533
533
534
+
### Adding Common Metadata to All Managed Resources (Desired State Aspects)
535
+
536
+
Operators often need to mark every resource they manage in a uniform way, for example with a
537
+
`app.kubernetes.io/managed-by` label, so that these resources can easily be identified, selected or
538
+
garbage-collected later on. Instead of repeating that logic in every `desired()` implementation, a
539
+
`DesiredStateAspect` can be registered once, at the operator level, and is then applied to the
540
+
desired state of every Kubernetes dependent resource managed by the operator:
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/BulkDependentResourceReconciler.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,10 @@ public R update(R actual, R desired, P primary, Context<P> context) {
Copy file name to clipboardExpand all lines: operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverriderTest.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/dependent/AbstractDependentResourceTest.java
0 commit comments