[
https://issues.apache.org/jira/browse/KNOX-3288?focusedWorklogId=1011673&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1011673
]
ASF GitHub Bot logged work on KNOX-3288:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Mar/26 21:28
Start Date: 26/Mar/26 21:28
Worklog Time Spent: 10m
Work Description: smolnar82 opened a new pull request, #1187:
URL: https://github.com/apache/knox/pull/1187
[KNOX-3288](https://issues.apache.org/jira/browse/KNOX-3288) - Database
support in Knox's Docker image
## What changes were proposed in this pull request?
### Summary of Changes:
This PR enhances the gateway-entrypoint.sh script to support gateway
database connection configuration via environment variables and refactors the
alias creation logic for better maintainability.
### Key Improvements:
- Database Configuration Support: Added support for
`DATABASE_CONNECTION_USER`, `DATABASE_CONNECTION_PASSWORD`, and
`DATABASE_CONNECTION_TRUSTSTORE_PASSWORD` environment variables, allowing these
to be configured as Knox aliases during Docker container startup.
- Refactored Alias Creation: Introduced a `saveAlias` helper function to
streamline the process of creating aliases from environment variables, reducing
code duplication and improving readability.
- Improved Code Quality:
- Updated line 49 from $(($CERTS - 1)) to $((CERTS - 1)) to resolve
CheckStyle/ShellCheck warnings.
- Quoted ${KEYSTORE_DIR} in truststore paths (e.g.,
"${KEYSTORE_DIR}"/truststore.jks) to ensure robust path handling and satisfy
CheckStyle requirements.
- Cleaned up Existing Logic: Migrated `ldap-bind-password`,
`knox.token.hash.key`, and `keystore password` alias creation to use the new
`saveAlias` function.
## How was this patch tested?
Runnning Docker tests here.
## Integration Tests
None yet
## UI changes
N/A
Issue Time Tracking
-------------------
Worklog Id: (was: 1011673)
Remaining Estimate: 0h
Time Spent: 10m
> Knox's Docker image should create database connection related aliases
> ---------------------------------------------------------------------
>
> Key: KNOX-3288
> URL: https://issues.apache.org/jira/browse/KNOX-3288
> Project: Apache Knox
> Issue Type: Task
> Components: docker
> Affects Versions: 3.0.0
> Reporter: Sandor Molnar
> Priority: Major
> Fix For: 3.0.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> In k8s clusters it's important that Knox instances can connect to an external
> DB so that generated tokens won't get lost on pod restarts.
> To support that, we need to update the Knox Gateway entry point in the Docker
> image to save the following aliases:
> * gateway_database_user
> * gateway_database_password
> * gateway_database_ssl_truststore_password
--
This message was sent by Atlassian Jira
(v8.20.10#820010)