Skip to content

Commit 1bbad4c

Browse files
authored
Make it easier to use a custom image in tests (#550)
1 parent ae6266d commit 1bbad4c

18 files changed

+87
-1
lines changed

tests/templates/kuttl/cluster-operation/20-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: hdfs
1010
spec:
1111
image:
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
dfsReplication: 1

tests/templates/kuttl/cluster-operation/30-stop-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: hdfs
1010
spec:
1111
image:
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
dfsReplication: 1

tests/templates/kuttl/cluster-operation/40-pause-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: hdfs
1010
spec:
1111
image:
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
dfsReplication: 1

tests/templates/kuttl/cluster-operation/50-restart-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: hdfs
1010
spec:
1111
image:
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
dfsReplication: 1

tests/templates/kuttl/external-access/30-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ metadata:
1111
name: hdfs
1212
spec:
1313
image:
14+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
15+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
16+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
17+
{% else %}
1418
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
19+
{% endif %}
1520
pullPolicy: IfNotPresent
1621
clusterConfig:
1722
zookeeperConfigMapName: hdfs-zk

tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: hdfs
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
clusterConfig:
1116
zookeeperConfigMapName: hdfs-zk

tests/templates/kuttl/kerberos/30-access-hdfs.txt.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ spec:
99
serviceAccountName: test-sa
1010
containers:
1111
- name: access-hdfs
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
{% else %}
1215
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
16+
{% endif %}
1317
env:
1418
- name: HADOOP_CONF_DIR
1519
value: /stackable/conf/hdfs

tests/templates/kuttl/kerberos/32-check-file.txt.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ spec:
99
serviceAccountName: test-sa
1010
containers:
1111
- name: check-hdfs
12+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
13+
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
14+
{% else %}
1215
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
16+
{% endif %}
1317
env:
1418
- name: HADOOP_CONF_DIR
1519
value: /stackable/conf/hdfs

tests/templates/kuttl/logging/04-install-hdfs-automatic-log.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: test-hdfs-automatic-log
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
clusterConfig:
1116
vectorAggregatorConfigMapName: hdfs-vector-aggregator-discovery

tests/templates/kuttl/logging/05-install-hdfs-custom-log.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ metadata:
6262
name: test-hdfs-custom-log
6363
spec:
6464
image:
65+
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
66+
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
67+
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
68+
{% else %}
6569
productVersion: "{{ test_scenario['values']['hadoop'] }}"
70+
{% endif %}
6671
pullPolicy: IfNotPresent
6772
clusterConfig:
6873
vectorAggregatorConfigMapName: hdfs-vector-aggregator-discovery

tests/templates/kuttl/orphaned-resources/02-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: test-hdfs
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
clusterConfig:
1116
dfsReplication: 1

tests/templates/kuttl/orphaned-resources/03-remove-datanode.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: test-hdfs
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
clusterConfig:
1116
dfsReplication: 1

tests/templates/kuttl/orphaned-resources/04-change-datanode-rolegroup.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: test-hdfs
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
dataNodes:
1116
config:

tests/templates/kuttl/profiling/03-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ metadata:
55
name: test-hdfs
66
spec:
77
image:
8+
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
11+
{% else %}
812
productVersion: "{{ test_scenario['values']['hadoop'] }}"
13+
{% endif %}
914
pullPolicy: IfNotPresent
1015
clusterConfig:
1116
dfsReplication: 1

tests/templates/kuttl/smoke/30-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ metadata:
1111
name: hdfs
1212
spec:
1313
image:
14+
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
15+
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
16+
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
17+
{% else %}
1418
productVersion: "{{ test_scenario['values']['hadoop'] }}"
19+
{% endif %}
1520
pullPolicy: IfNotPresent
1621
clusterConfig:
1722
zookeeperConfigMapName: hdfs-zk

tests/templates/kuttl/topology-provider/11-install-hdfs.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ commands:
1111
name: hdfs
1212
spec:
1313
image:
14+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
15+
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
16+
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
17+
{% else %}
1418
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
19+
{% endif %}
1520
pullPolicy: IfNotPresent
1621
clusterConfig:
1722
zookeeperConfigMapName: hdfs-zk

tests/templates/kuttl/topology-provider/20-access-hdfs.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ commands:
1515
serviceAccountName: test-sa
1616
containers:
1717
- name: access-hdfs
18+
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
19+
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
20+
{% else %}
1821
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
22+
{% endif %}
1923
env:
2024
- name: HADOOP_CONF_DIR
2125
value: /stackable/conf/hdfs

tests/test-definition.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ dimensions:
55
- 3.3.4
66
- 3.3.6
77
- 3.4.0
8+
# To use a custom image, add a comma and the full name after the product version
9+
# - 3.4.0,docker.stackable.tech/sandbox/hadoop:3.4.0-stackable0.0.0-dev
810
- name: hadoop-latest
911
values:
10-
- 3.3.6
12+
- 3.4.0
13+
# To use a custom image, add a comma and the full name after the product version
14+
# - 3.4.0,docker.stackable.tech/sandbox/hadoop:3.4.0-stackable0.0.0-dev
1115
- name: hadoop-external-client-docker-image
1216
values:
1317
- 3.3.6

0 commit comments

Comments
 (0)