Skip to content

Commit c688524

Browse files
committed
test exp timeout
1 parent 584bc71 commit c688524

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

docs/documentation/features.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,8 @@ See also an example implementation in the
713713

714714
## Optimization of Caches
715715

716+
In case of large clusters with huge amount of resources the memory consumption of an operator
717+
716718
## Automatic Generation of CRDs
717719

718720
Note that this feature is provided by the

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResourceConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.javaoperatorsdk.operator.OperatorException;
1010
import io.javaoperatorsdk.operator.ReconcilerUtils;
1111
import io.javaoperatorsdk.operator.api.reconciler.Constants;
12+
import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration;
1213
import io.javaoperatorsdk.operator.processing.event.source.filter.GenericFilter;
1314
import io.javaoperatorsdk.operator.processing.event.source.filter.OnAddFilter;
1415
import io.javaoperatorsdk.operator.processing.event.source.filter.OnUpdateFilter;
@@ -110,6 +111,9 @@ default Set<String> getEffectiveNamespaces() {
110111
return targetNamespaces;
111112
}
112113

114+
/**
115+
* See {@link ControllerConfiguration#cachePruneFunction()} for details.
116+
*/
113117
default Optional<UnaryOperator<R>> cachePruneFunction() {
114118
return Optional.empty();
115119
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ MaxReconciliationInterval maxReconciliationInterval() default @MaxReconciliation
125125
* that this has subtle implications how updates on the resources should be handled. Notably only
126126
* patching of the resource can be used from that point, since update would remove not cached
127127
* parts of the resource.
128+
* <p>
129+
* Note that this feature does not work with Dependent Resources.
130+
* </p>
128131
*
129132
* @return function to remove parts of the resource.
130133
*/

operator-framework/src/test/java/io/javaoperatorsdk/operator/CachePruneIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.javaoperatorsdk.operator;
22

3+
import java.time.Duration;
34
import java.util.Map;
45

56
import org.junit.jupiter.api.Test;
@@ -43,7 +44,7 @@ void pruningRelatedBehavior() {
4344

4445
operator.delete(updated);
4546

46-
await().untilAsserted(() -> {
47+
await().atMost(Duration.ofSeconds(30)).untilAsserted(() -> {
4748
var actual = operator.get(CachePruneCustomResource.class, TEST_RESOURCE_NAME);
4849
var configMap = operator.get(ConfigMap.class, TEST_RESOURCE_NAME);
4950
assertThat(configMap).isNull();

0 commit comments

Comments
 (0)