File tree 3 files changed +5
-4
lines changed
sample-operators/leader-election
src/test/java/io/javaoperatorsdk/operator/sample
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 7
7
containers :
8
8
- name : operator
9
9
image : leader-election-operator
10
- imagePullPolicy : IfNotPresent
10
+ imagePullPolicy : Never
11
11
env :
12
12
- name : POD_NAMESPACE
13
13
valueFrom :
Original file line number Diff line number Diff line change 13
13
containers :
14
14
- name : operator
15
15
image : leader-election-operator
16
- imagePullPolicy : IfNotPresent
16
+ imagePullPolicy : Never
17
17
env :
18
18
- name : POD_NAMESPACE
19
19
valueFrom :
Original file line number Diff line number Diff line change 14
14
import org .junit .jupiter .api .AfterEach ;
15
15
import org .junit .jupiter .api .BeforeEach ;
16
16
import org .junit .jupiter .api .Test ;
17
+ import org .junit .jupiter .api .condition .EnabledIfSystemProperty ;
17
18
import org .slf4j .Logger ;
18
19
import org .slf4j .LoggerFactory ;
19
20
@@ -45,6 +46,8 @@ class LeaderElectionE2E {
45
46
private KubernetesClient client ;
46
47
47
48
@ Test
49
+ // not for local mode by design
50
+ @ EnabledIfSystemProperty (named = "test.deployment" , matches = "remote" )
48
51
void otherInstancesTakesOverWhenSteppingDown () {
49
52
log .info ("Deploying operator" );
50
53
deployOperatorsInOrder ();
@@ -128,8 +131,6 @@ private void deployOperatorsInOrder() {
128
131
applyResources ("k8s/operator.yaml" );
129
132
await ().atMost (Duration .ofSeconds (POD_STARTUP_TIMEOUT )).untilAsserted (() -> {
130
133
var pod = client .pods ().inNamespace (namespace ).withName (OPERATOR_1_POD_NAME ).get ();
131
- log .info ("Operator 1: {}" , pod );
132
-
133
134
assertThat (pod .getStatus ().getContainerStatuses ().get (0 ).getReady ()).isTrue ();
134
135
});
135
136
You can’t perform that action at this time.
0 commit comments