sonic-buildimage/dockers/docker-database/database_global.json.j2
Ze Gan 0e58512353
[docker-databse]: Revise database_global schema for dpu (#17443)
### Why I did it
Revise DPU's database_global.json schema to achieve a more general design

### How I did it
1. Remove databse_type
2. Add a new field databse_name
2023-12-29 14:20:52 -08:00

43 lines
884 B
Django/Jinja

{% set namespace_cnt = NAMESPACE_COUNT|int %}
{% if NUM_DPU is defined %}
{% set dpu_cnt = NUM_DPU | int %}
{% else %}
{% set dpu_cnt = 0 %}
{% endif %}
{
"INCLUDES" : [
{
"include" : "../../redis/sonic-db/database_config.json"
},
{% if namespace_cnt > 1 %}
{% for ns in range(namespace_cnt) %}
{
"namespace" : "{{NAMESPACE_PREFIX}}{{ns}}",
"include" : "../../redis{{ns}}/sonic-db/database_config.json"
{% if ns == namespace_cnt-1 %}
}
{% else %}
},
{% endif %}
{% endfor %}
{% endif %}
{% if dpu_cnt > 0 %}
{% for dpu in range(dpu_cnt) %}
{
"database_name" : "dpu{{dpu}}",
"include" : "../../redisdpu{{dpu}}/sonic-db/database_config.json"
{% if dpu == dpu_cnt-1 %}
}
{% else %}
},
{% endif %}
{% endfor %}
{% endif %}
],
"VERSION" : "1.0"
}