Fix migration init container env vars and ConnectionMonitor crash

- Add missing env vars to migration init container (PHX_HOST, PORT,
  APRS_PORT, APRS_CALLSIGN, APRS_PASSCODE) so runtime.exs config
  provider doesn't fail due to Kubernetes service discovery injecting
  APRS_PORT as a full URL
- Guard ConnectionMonitor.accepting_connections?/0 with Process.whereis
  to avoid crashing when the GenServer isn't started (e.g. cluster
  enabled but no libcluster topologies configured)
This commit is contained in:
Graham McIntire 2026-02-18 11:51:51 -06:00
parent e71034dd47
commit d886f5d987
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View file

@ -48,6 +48,14 @@ spec:
value: "prod"
- name: SKIP_DB_CREATE
value: "true"
- name: PHX_HOST
value: "aprs.me"
- name: PORT
value: "4000"
- name: APRS_PORT
value: "10152"
- name: APRS_CALLSIGN
value: "w5isp-1"
- name: RELEASE_COOKIE
valueFrom:
secretKeyRef:
@ -58,6 +66,11 @@ spec:
secretKeyRef:
name: aprs-secrets
key: SECRET_KEY_BASE
- name: APRS_PASSCODE
valueFrom:
secretKeyRef:
name: aprs-secrets
key: APRS_PASSCODE
envFrom:
- secretRef:
name: aprs-db

View file

@ -66,7 +66,7 @@ defmodule Aprsme.ConnectionMonitor do
Check if this node should accept new connections
"""
def accepting_connections? do
if cluster_enabled?() do
if cluster_enabled?() and Process.whereis(__MODULE__) != nil do
GenServer.call(__MODULE__, :accepting_connections?)
else
true