File tree 2 files changed +11
-2
lines changed
sample-operators/controller-namespace-deletion
src/test/java/io/javaoperatorsdk/operator/sample
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ This sample demonstrates the workaround for problem when a namespace
2
+ is being deleted with a running controller, that watches resources
3
+ in its own namespace. If the pod or other underlying resources (role,
4
+ role binding, service account) are deleted before the cleanup of
5
+ the custom resource the namespace deletion is stuck.
6
+
7
+ see also: https://github.com/operator-framework/java-operator-sdk/pull/2528
8
+
Original file line number Diff line number Diff line change 10
10
11
11
import org .junit .jupiter .api .BeforeEach ;
12
12
import org .junit .jupiter .api .Test ;
13
+ import org .junit .jupiter .api .condition .EnabledIfSystemProperty ;
13
14
import org .slf4j .Logger ;
14
15
import org .slf4j .LoggerFactory ;
15
16
@@ -39,7 +40,7 @@ class ControllerNamespaceDeletionE2E {
39
40
KubernetesClient client ;
40
41
41
42
// not for local mode by design
42
- // @EnabledIfSystemProperty(named = "test.deployment", matches = "remote")
43
+ @ EnabledIfSystemProperty (named = "test.deployment" , matches = "remote" )
43
44
@ Test
44
45
void customResourceCleanedUpOnNamespaceDeletion () {
45
46
deployController ();
@@ -60,7 +61,7 @@ void customResourceCleanedUpOnNamespaceDeletion() {
60
61
assertThat (ns ).isNull ();
61
62
});
62
63
63
- log .info ("Removing finalizers from role and role bing" );
64
+ log .info ("Removing finalizers from role and role bing and service account " );
64
65
removeRoleAndRoleBindingFinalizers ();
65
66
66
67
await ().timeout (Duration .ofSeconds (20 )).untilAsserted (() -> {
You can’t perform that action at this time.
0 commit comments