-
Notifications
You must be signed in to change notification settings - Fork 2
issue/64 add env vars to omns-core-init.sh to configure opennms-datas… #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ources.xml and bump chart.yaml version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds environment variable configuration support for OpenNMS database connection pool settings in the initialization script. Previously, most connection pool parameters were hardcoded; now they can be configured via environment variables.
Key Changes:
- Added environment variables for database connection pool configuration (idle timeout, login timeout, min pool, max pool, max size)
- Applied these configurable parameters to all three database connection configurations in opennms-datasources.xml
- Bumped chart version from 1.1.20 to 1.1.21
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| horizon/scripts/onms-core-init.sh | Added environment variable defaults and applied them to database connection pool configurations in opennms-datasources.xml |
| horizon/Chart.yaml | Incremented chart version to reflect the configuration changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
horizon/scripts/onms-core-init.sh
Outdated
| # Defaults | ||
| OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT:-600}" | ||
| OPENNMS_DATABASE_CONNECTION_LOGINTIMEOUT="${OPENNMS_DATABASE_CONNECTION_LOGINTIMEOUT:-3}" | ||
| OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MAXSIZE:-25}" |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MINPOOL variable is incorrectly using MAXSIZE as its source. It should use OPENNMS_DATABASE_CONNECTION_MINPOOL instead: OPENNMS_DATABASE_CONNECTION_MINPOOL=\"${OPENNMS_DATABASE_CONNECTION_MINPOOL:-25}\"
| OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MAXSIZE:-25}" | |
| OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MINPOOL:-25}" |
…E_CONNECTION_MINPOOL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| maxPool="10" | ||
| maxSize="50" /> | ||
| <connection-pool idleTimeout="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT}" | ||
| minPool="${OPENNMS_DATABASE_CONNECTION_MINPOOL}" |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minPool values for template1 and postgres datasources are now set to 25 (from the default), but were previously hardcoded to 0. This changes the behavior of these connection pools and may cause resource consumption issues. Consider using a separate environment variable for these datasources or documenting this breaking change.
| maxPool="10" | ||
| maxSize="50" /> | ||
| <connection-pool idleTimeout="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT}" | ||
| minPool="${OPENNMS_DATABASE_CONNECTION_MINPOOL}" |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minPool values for template1 and postgres datasources are now set to 25 (from the default), but were previously hardcoded to 0. This changes the behavior of these connection pools and may cause resource consumption issues. Consider using a separate environment variable for these datasources or documenting this breaking change.
…ources.xml