|
1 | 1 | package io.javaoperatorsdk.operator.api.reconciler.dependent; |
2 | 2 |
|
3 | 3 | import io.fabric8.kubernetes.api.model.HasMetadata; |
| 4 | +import io.javaoperatorsdk.operator.api.reconciler.Context; |
4 | 5 |
|
5 | 6 | /** |
6 | | - * Should be implemented by {@link DependentResource} implementations that are explicitly deleted |
7 | | - * during reconciliation but which should also benefit from Kubernetes' automated garbage collection |
8 | | - * during the cleanup phase. |
| 7 | + * <p> |
| 8 | + * Can be implemented by a dependent resource extending |
| 9 | + * {@link io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResource} |
| 10 | + * to express that the resource deletion is handled by the controller during |
| 11 | + * {@link DependentResource#reconcile(HasMetadata, Context)}. This takes effect during a |
| 12 | + * reconciliation workflow, but not during a cleanup workflow, when a {@code reconcilePrecondition} |
| 13 | + * is not met for the resource or a resource on which the the dependent that implements this |
| 14 | + * interface depends on is not ready ({@code readyPostCondition} not met). In this case, |
| 15 | + * {@link #delete(HasMetadata, Context)} is called. During a cleanup workflow, however, |
| 16 | + * {@link #delete(HasMetadata, Context)} is not called, letting the Kubernetes garbage collector do |
| 17 | + * its work instead (using owner references). |
| 18 | + * </p> |
| 19 | + * <p> |
| 20 | + * If a dependent resource implement this interface, an owner reference pointing to the associated |
| 21 | + * primary resource will be automatically added to this managed resource. |
| 22 | + * </p> |
9 | 23 | * <p> |
10 | 24 | * See <a href="https://github.com/java-operator-sdk/java-operator-sdk/issues/1127">this issue</a> |
11 | 25 | * for more details. |
| 26 | + * </p> |
12 | 27 | */ |
13 | 28 | public interface GarbageCollected<P extends HasMetadata> extends Deleter<P> { |
14 | | - |
15 | 29 | } |
0 commit comments