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:
parent
e71034dd47
commit
d886f5d987
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue