Skip to content

Commit 007b369

Browse files
committed
chore: apply CRD before deploying the operators, add more logging
1 parent 0c0758d commit 007b369

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sample-operators/leader-election/src/test/java/io/javaoperatorsdk/operator/sample/LeaderElectionE2E.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ class LeaderElectionE2E {
5050
// not for local mode by design
5151
@EnabledIfSystemProperty(named = "test.deployment", matches = "remote")
5252
void otherInstancesTakesOverWhenSteppingDown() {
53-
log.info("Deploying operator");
54-
deployOperatorsInOrder();
5553
log.info("Applying custom resource");
5654
applyCustomResource();
55+
log.info("Deploying operator instances");
56+
deployOperatorsInOrder();
5757

5858
log.info("Awaiting custom resource reconciliations");
5959
await().pollDelay(Duration.ofSeconds(MINIMAL_SECONDS_FOR_RENEWAL))
@@ -131,12 +131,14 @@ void tearDown() {
131131
}
132132

133133
private void deployOperatorsInOrder() {
134+
log.info("Installing 1st instance");
134135
applyResources("k8s/operator.yaml");
135136
await().atMost(Duration.ofSeconds(POD_STARTUP_TIMEOUT)).untilAsserted(() -> {
136137
var pod = client.pods().inNamespace(namespace).withName(OPERATOR_1_POD_NAME).get();
137138
assertThat(pod.getStatus().getContainerStatuses().get(0).getReady()).isTrue();
138139
});
139140

141+
log.info("Installing 2nd instance");
140142
applyResources("k8s/operator-instance-2.yaml");
141143
await().atMost(Duration.ofSeconds(POD_STARTUP_TIMEOUT)).untilAsserted(() -> {
142144
var pod = client.pods().inNamespace(namespace).withName(OPERATOR_2_POD_NAME).get();

0 commit comments

Comments
 (0)