Interface ResourceController<R extends io.fabric8.kubernetes.client.CustomResource>
-
- All Known Implementing Classes:
ResourceControllerAdapter
public interface ResourceController<R extends io.fabric8.kubernetes.client.CustomResource>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<R>createOrUpdateResource(R resource, Context<R> context)The implementation of this operation is required to be idempotent.booleandeleteResource(R resource, Context<R> context)The implementation should delete the associated component(s).
-
-
-
Method Detail
-
deleteResource
boolean deleteResource(R resource, Context<R> context)
The implementation should delete the associated component(s). Note that this is method is called when an object is marked for deletion. After its executed the default finalizer is automatically removed by the framework; unless the return value is false - note that this is almost never the case.- Parameters:
resource-context-- Returns:
- true - so the finalizer is automatically removed after the call. false if you don't want to remove the finalizer. Note that this is ALMOST NEVER the case.
-
createOrUpdateResource
java.util.Optional<R> createOrUpdateResource(R resource, Context<R> context)
The implementation of this operation is required to be idempotent.- Returns:
- The resource is updated in api server if the return value is present within Optional. This the common use cases. However in cases, for example the operator is restarted, and we don't want to have an update call to k8s api to be made unnecessarily, by returning an empty Optional this update can be skipped. However we will always call an update if there is no finalizer on object and its not marked for deletion.
-
-