Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion horizon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.20
version: 1.1.21

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
75 changes: 0 additions & 75 deletions horizon/scripts/onms-core-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,82 +285,7 @@ acknowledged-by=admin
acknowledged-at=Sun Mar 01 00\:00\:00 EDT 2020
EOF

# Configure Database access
USE_UPDATED_DATASOURCE=false
if [ "${MAJOR}" -eq 32 ];then
if [ "${MINOR}" -gt 0 ];then
USE_UPDATED_DATASOURCE=true
elif [ "${MINOR}" -eq 0 ] && [ "${PATCH}" -ge 4 ];then
USE_UPDATED_DATASOURCE=true
else
USE_UPDATED_DATASOURCE=false
fi
elif [ "${MAJOR}" -ge 33 ] && [ "${MAJOR}" -lt 2000 ]; then
USE_UPDATED_DATASOURCE=true
else
USE_UPDATED_DATASOURCE=false
fi
echo "Creating datasource configuration in ${CONFIG_DIR_OVERLAY}/opennms-datasources.xml (USE_UPDATED_DATASOURCE: $USE_UPDATED_DATASOURCE)"
cat <<EOF > ${CONFIG_DIR_OVERLAY}/opennms-datasources.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasource-configuration xmlns:this="http://xmlns.opennms.org/xsd/config/opennms-datasources"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.opennms.org/xsd/config/opennms-datasources
http://www.opennms.org/xsd/config/opennms-datasources.xsd ">

<connection-pool factory="org.opennms.core.db.HikariCPConnectionFactory"
idleTimeout="600"
loginTimeout="3"
minPool="50"
maxPool="${OPENNMS_DATABASE_CONNECTION_MAXPOOL}"
maxSize="50" />

<jdbc-data-source name="opennms"
database-name="${OPENNMS_DBNAME}"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/${OPENNMS_DBNAME}?sslmode=${POSTGRES_SSL_MODE}&amp;sslfactory=${POSTGRES_SSL_FACTORY}"
user-name="${OPENNMS_DBUSER}"
password="${OPENNMS_DBPASS}" />

EOF
if $USE_UPDATED_DATASOURCE; then
cat <<EOF >> ${CONFIG_DIR_OVERLAY}/opennms-datasources.xml
<jdbc-data-source name="opennms-admin"
database-name="template1"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/template1?sslmode=${POSTGRES_SSL_MODE}&amp;sslfactory=${POSTGRES_SSL_FACTORY}"
user-name="${POSTGRES_USER}"
password="${POSTGRES_PASSWORD}">
<connection-pool idleTimeout="600"
minPool="0"
maxPool="10"
maxSize="50" />
</jdbc-data-source>

<jdbc-data-source name="opennms-monitor"
database-name="postgres"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/postgres?sslmode=${POSTGRES_SSL_MODE}&amp;sslfactory=${POSTGRES_SSL_FACTORY}"
user-name="${POSTGRES_USER}"
password="${POSTGRES_PASSWORD}">
<connection-pool idleTimeout="600"
minPool="0"
maxPool="10"
maxSize="50" />
</jdbc-data-source>
</datasource-configuration>
EOF
else
cat <<EOF >> ${CONFIG_DIR_OVERLAY}/opennms-datasources.xml
<jdbc-data-source name="opennms-admin"
database-name="template1"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/template1?sslmode=${POSTGRES_SSL_MODE}&amp;sslfactory=${POSTGRES_SSL_FACTORY}"
user-name="${POSTGRES_USER}"
password="${POSTGRES_PASSWORD}"/>
</datasource-configuration>
EOF
fi

# Enable storeByGroup to improve performance
Comment on lines 288 to 290

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the datasource configuration logic leaves no clear indication of how opennms-datasources.xml should now be configured. Consider adding a comment explaining the new approach for configuring database connections, or verify that this configuration is now handled elsewhere (e.g., via environment variables, a ConfigMap, or a different initialization mechanism).

Copilot uses AI. Check for mistakes.
# RRD Strategy is enabled by default
Expand Down