Skip to content

Commit ddfeaf4

Browse files
authored
chore(hbase): Convert sed calls to config-utils where possible (#1301)
* convert sed calls to config-utils where possible * changelog * changelog order
1 parent 4458cda commit ddfeaf4

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ All notable changes to this project will be documented in this file.
4444
- tools: Bump dependency versions - kubectl to `1.34.1`, yq to `4.47.2`, and jq to `1.8.1` ([#1290]).
4545
- testing-tools: Update keycloak dependency to `26.3.5` and `python:3.12-slim-bullseye` base image ([#1289]).
4646
- hbase: move hbck2.env to hbase-operator-tools image and add log4j2 properties for this tool ([#1300]).
47+
- hbase: replace `sed` calls with `config-utils template` where possible ([#1301]).
4748

4849
### Removed
4950

@@ -91,6 +92,7 @@ All notable changes to this project will be documented in this file.
9192
[#1293]: https://github.com/stackabletech/docker-images/pull/1293
9293
[#1296]: https://github.com/stackabletech/docker-images/pull/1296
9394
[#1300]: https://github.com/stackabletech/docker-images/pull/1300
95+
[#1301]: https://github.com/stackabletech/docker-images/pull/1301
9496

9597
## [25.7.0] - 2025-07-23
9698

hbase/hbase/stackable/bin/hbase-entrypoint.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ HBASE_UI_PORT_NAME="$4"
2020

2121
# Needed for regionmover service and for hbase-site.xml (see below)
2222
HBASE_SERVICE_HOST=$(cat /stackable/listener/default-address/address)
23+
export HBASE_SERVICE_HOST
2324

2425
REGION_MOVER_OPTS="--regionserverhost ${HBASE_SERVICE_HOST}:${HBASE_ROLE_SERVICE_PORT} --operation unload ${REGION_MOVER_OPTS}"
2526

@@ -57,9 +58,9 @@ wait_for_termination() {
5758
set -e
5859
}
5960

60-
# ##################################################################################################
61+
# #############################################################################
6162
# main
62-
# ##################################################################################################
63+
# #############################################################################
6364
mkdir -p /stackable/conf
6465
cp /stackable/tmp/hdfs/hdfs-site.xml /stackable/conf
6566
cp /stackable/tmp/hdfs/core-site.xml /stackable/conf
@@ -70,20 +71,20 @@ cp /stackable/tmp/log_config/log4j* /stackable/conf
7071
if [ -f /stackable/kerberos/krb5.conf ]; then
7172
KERBEROS_REALM=$(grep -oP 'default_realm = \K.*' /stackable/kerberos/krb5.conf)
7273
export KERBEROS_REALM
74+
# the hdfs discovery files are not written by the hbase operator and use
75+
# the dot notation, so they cannot be used with config-utils
7376
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/core-site.xml
74-
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/hbase-site.xml
7577
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/hdfs-site.xml
7678
fi
7779

7880
# Service endpoints
7981
HBASE_SERVICE_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_PORT_NAME}")
8082
HBASE_INFO_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_UI_PORT_NAME}")
81-
HBASE_LISTENER_ENDPOINT="$HBASE_SERVICE_HOST:$HBASE_INFO_PORT"
8283

83-
sed -i -e s/\$\{HBASE_SERVICE_HOST\}/"${HBASE_SERVICE_HOST}"/g /stackable/conf/hbase-site.xml
84-
sed -i -e s/\$\{HBASE_SERVICE_PORT\}/"${HBASE_SERVICE_PORT}"/g /stackable/conf/hbase-site.xml
85-
sed -i -e s/\$\{HBASE_LISTENER_ENDPOINT\}/"${HBASE_LISTENER_ENDPOINT}"/g /stackable/conf/hbase-site.xml
86-
sed -i -e s/\$\{HBASE_INFO_PORT\}/"${HBASE_INFO_PORT}"/g /stackable/conf/hbase-site.xml
84+
export HBASE_SERVICE_PORT
85+
export HBASE_INFO_PORT
86+
87+
config-utils template /stackable/conf/hbase-site.xml
8788

8889
rm -f "${STACKABLE_LOG_DIR}/_vector/shutdown"
8990
prepare_signal_handlers

0 commit comments

Comments
 (0)