Skip to content

Commit

Permalink
Make it easier to use a custom image in tests (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfrancke authored Sep 11, 2024
1 parent ae6266d commit 1bbad4c
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/cluster-operation/30-stop-hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/cluster-operation/40-pause-hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/external-access/30-install-hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
zookeeperConfigMapName: hdfs-zk
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
zookeeperConfigMapName: hdfs-zk
Expand Down
4 changes: 4 additions & 0 deletions tests/templates/kuttl/kerberos/30-access-hdfs.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ spec:
serviceAccountName: test-sa
containers:
- name: access-hdfs
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
{% else %}
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
{% endif %}
env:
- name: HADOOP_CONF_DIR
value: /stackable/conf/hdfs
Expand Down
4 changes: 4 additions & 0 deletions tests/templates/kuttl/kerberos/32-check-file.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ spec:
serviceAccountName: test-sa
containers:
- name: check-hdfs
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
{% else %}
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
{% endif %}
env:
- name: HADOOP_CONF_DIR
value: /stackable/conf/hdfs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: test-hdfs-automatic-log
spec:
image:
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
vectorAggregatorConfigMapName: hdfs-vector-aggregator-discovery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ metadata:
name: test-hdfs-custom-log
spec:
image:
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
vectorAggregatorConfigMapName: hdfs-vector-aggregator-discovery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: test-hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: test-hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: test-hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
dataNodes:
config:
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/profiling/03-install-hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ metadata:
name: test-hdfs
spec:
image:
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
dfsReplication: 1
Expand Down
5 changes: 5 additions & 0 deletions tests/templates/kuttl/smoke/30-install-hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ metadata:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
zookeeperConfigMapName: hdfs-zk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ commands:
name: hdfs
spec:
image:
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
custom: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
productVersion: "{{ test_scenario['values']['hadoop-latest'].split(',')[0] }}"
{% else %}
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}"
{% endif %}
pullPolicy: IfNotPresent
clusterConfig:
zookeeperConfigMapName: hdfs-zk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ commands:
serviceAccountName: test-sa
containers:
- name: access-hdfs
{% if test_scenario['values']['hadoop-latest'].find(",") > 0 %}
image: "{{ test_scenario['values']['hadoop-latest'].split(',')[1] }}"
{% else %}
image: docker.stackable.tech/stackable/hadoop:{{ test_scenario['values']['hadoop-latest'] }}-stackable0.0.0-dev
{% endif %}
env:
- name: HADOOP_CONF_DIR
value: /stackable/conf/hdfs
Expand Down
6 changes: 5 additions & 1 deletion tests/test-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ dimensions:
- 3.3.4
- 3.3.6
- 3.4.0
# To use a custom image, add a comma and the full name after the product version
# - 3.4.0,docker.stackable.tech/sandbox/hadoop:3.4.0-stackable0.0.0-dev
- name: hadoop-latest
values:
- 3.3.6
- 3.4.0
# To use a custom image, add a comma and the full name after the product version
# - 3.4.0,docker.stackable.tech/sandbox/hadoop:3.4.0-stackable0.0.0-dev
- name: hadoop-external-client-docker-image
values:
- 3.3.6
Expand Down

0 comments on commit 1bbad4c

Please sign in to comment.