Skip to content

Commit 8aa933b

Browse files
committed
integration test for handling resource created without finalizer
1 parent 718698d commit 8aa933b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: operator-framework/src/test/java/io/javaoperatorsdk/operator/SubResourceUpdateIT.java

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.junit.jupiter.api.Test;
1313
import org.junit.jupiter.api.TestInstance;
1414

15+
import java.util.Collections;
1516
import java.util.concurrent.TimeUnit;
1617

1718
import static io.javaoperatorsdk.operator.IntegrationTestSupport.TEST_NAMESPACE;
@@ -45,6 +46,22 @@ public void updatesSubResourceStatus() {
4546
});
4647
}
4748

49+
@Test
50+
public void updatesSubResourceStatusNoFinalizer() {
51+
integrationTestSupport.teardownIfSuccess(() -> {
52+
SubResourceTestCustomResource resource = createTestCustomResource("1");
53+
resource.getMetadata().setFinalizers(Collections.EMPTY_LIST);
54+
55+
integrationTestSupport.getCrOperations().inNamespace(TEST_NAMESPACE).create(resource);
56+
57+
awaitStatusUpdated(resource.getMetadata().getName());
58+
// wait for sure, there are no more events
59+
waitXms(200);
60+
// there is no event on status update processed
61+
assertThat(integrationTestSupport.numberOfControllerExecutions()).isEqualTo(2);
62+
});
63+
}
64+
4865
/**
4966
* Note that we check on controller impl if there is finalizer on execution.
5067
*/

0 commit comments

Comments
 (0)