Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit fc06571

Browse files
committed
adding nfsd port to state
1 parent bc3f702 commit fc06571

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ readonly STATE_LOG_LEVEL='log_level'
6565
readonly STATE_IS_LOGGING_DEBUG='is_logging_debug'
6666
readonly STATE_IS_LOGGING_INFO='is_logging_info'
6767
readonly STATE_NFSD_THREAD_COUNT='nfsd_thread_count'
68+
readonly STATE_NFSD_PORT='nfsd_port'
6869

6970
# "state" is our only global variable, which is an associative array of normalized data
7071
declare -A state
@@ -252,7 +253,7 @@ get_requested_port_mountd() {
252253

253254
get_requested_port_nfsd() {
254255

255-
echo "${!ENV_VAR_NFS_PORT:-$DEFAULT_NFS_PORT}"
256+
echo "${state[$STATE_NFSD_PORT]}"
256257
}
257258

258259
get_requested_port_statd_in() {
@@ -452,6 +453,12 @@ init_state_nfsd_thread_count() {
452453
state[$STATE_NFSD_THREAD_COUNT]=$count
453454
}
454455

456+
init_state_nfsd_port() {
457+
458+
assert_port "$ENV_VAR_NFS_PORT"
459+
state[$STATE_NFSD_PORT]=${!ENV_VAR_NFS_PORT:-$DEFAULT_NFS_PORT}
460+
}
461+
455462
init_trap() {
456463

457464
trap stop SIGTERM SIGINT
@@ -532,7 +539,6 @@ init_exports() {
532539
init_assertions() {
533540

534541
# validate any user-supplied environment variables
535-
assert_port "$ENV_VAR_NFS_PORT"
536542
assert_port "$ENV_VAR_NFS_PORT_MOUNTD"
537543
assert_port "$ENV_VAR_NFS_PORT_STATD_IN"
538544
assert_port "$ENV_VAR_NFS_PORT_STATD_OUT"
@@ -816,6 +822,7 @@ init() {
816822
init_state_logging
817823
init_exports
818824
init_state_nfsd_thread_count
825+
init_state_nfsd_port
819826
init_assertions
820827
init_trap
821828

0 commit comments

Comments
 (0)