Skip to content

Commit 243b546

Browse files
committed
disable test for local mode
1 parent 5bf82b2 commit 243b546

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

sample-operators/leader-election/k8s/operator-instance-2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
containers:
88
- name: operator
99
image: leader-election-operator
10-
imagePullPolicy: IfNotPresent
10+
imagePullPolicy: Never
1111
env:
1212
- name: POD_NAMESPACE
1313
valueFrom:

sample-operators/leader-election/k8s/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
containers:
1414
- name: operator
1515
image: leader-election-operator
16-
imagePullPolicy: IfNotPresent
16+
imagePullPolicy: Never
1717
env:
1818
- name: POD_NAMESPACE
1919
valueFrom:

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.junit.jupiter.api.AfterEach;
1515
import org.junit.jupiter.api.BeforeEach;
1616
import org.junit.jupiter.api.Test;
17+
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
1718
import org.slf4j.Logger;
1819
import org.slf4j.LoggerFactory;
1920

@@ -45,6 +46,8 @@ class LeaderElectionE2E {
4546
private KubernetesClient client;
4647

4748
@Test
49+
// not for local mode by design
50+
@EnabledIfSystemProperty(named = "test.deployment", matches = "remote")
4851
void otherInstancesTakesOverWhenSteppingDown() {
4952
log.info("Deploying operator");
5053
deployOperatorsInOrder();
@@ -128,8 +131,6 @@ private void deployOperatorsInOrder() {
128131
applyResources("k8s/operator.yaml");
129132
await().atMost(Duration.ofSeconds(POD_STARTUP_TIMEOUT)).untilAsserted(() -> {
130133
var pod = client.pods().inNamespace(namespace).withName(OPERATOR_1_POD_NAME).get();
131-
log.info("Operator 1: {}", pod);
132-
133134
assertThat(pod.getStatus().getContainerStatuses().get(0).getReady()).isTrue();
134135
});
135136

0 commit comments

Comments
 (0)