mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-06-17 04:44:12 +00:00
fix(upgrade): forward per-node flags to remote so --with-ntfy actually lands
`orama node upgrade --node <ip> --with-ntfy --restart` parsed the flag locally but `upgradeNode()` ran a hardcoded `orama node upgrade --restart` on the remote — dropping --with-ntfy, --nameserver, --force, and --skip-checks on the floor. The remote orchestrator then read the SAVED preference (or default false for nameserver/ntfy), so operator overrides like enabling ntfy on a nameserver were silently ignored. Bug surfaced in devnet today: running --with-ntfy reported success but ntfy was never installed. Fix forwards the four passthrough flags to the remote command, preserving the tri-state semantics for the pointer flags (nil = honor saved preference; non-nil = explicit override). VERSION bumped to 0.122.15.
This commit is contained in:
parent
07638354d2
commit
8c37ef547e
@ -67,9 +67,41 @@ func (r *RemoteUpgrader) Execute() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// upgradeNode runs `orama node upgrade --restart` on a single remote node.
|
||||
// upgradeNode runs `orama node upgrade --restart` on a single remote node,
|
||||
// forwarding the per-node flags the operator passed locally (--with-ntfy,
|
||||
// --nameserver, --force, --skip-checks) so the remote orchestrator sees the
|
||||
// same intent. Without this forwarding, the remote command would always use
|
||||
// the saved preference, silently dropping operator overrides like
|
||||
// `--with-ntfy` on the floor.
|
||||
func (r *RemoteUpgrader) upgradeNode(node inspector.Node) error {
|
||||
sudo := remotessh.SudoPrefix(node)
|
||||
cmd := fmt.Sprintf("%sorama node upgrade --restart", sudo)
|
||||
|
||||
// Tri-state pointer flags: forward only when explicitly set locally.
|
||||
// nil = "honor saved preference on the remote" — don't pass anything.
|
||||
if r.flags.NtfyHost != nil {
|
||||
if *r.flags.NtfyHost {
|
||||
cmd += " --with-ntfy"
|
||||
} else {
|
||||
cmd += " --with-ntfy=false"
|
||||
}
|
||||
}
|
||||
if r.flags.Nameserver != nil {
|
||||
if *r.flags.Nameserver {
|
||||
cmd += " --nameserver"
|
||||
} else {
|
||||
cmd += " --nameserver=false"
|
||||
}
|
||||
}
|
||||
|
||||
// Plain booleans: forward when true. False is the default everywhere
|
||||
// so no need to send `=false` explicitly.
|
||||
if r.flags.Force {
|
||||
cmd += " --force"
|
||||
}
|
||||
if r.flags.SkipChecks {
|
||||
cmd += " --skip-checks"
|
||||
}
|
||||
|
||||
return remotessh.RunSSHStreaming(node, cmd)
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@debros/orama",
|
||||
"version": "0.122.14",
|
||||
"version": "0.122.15",
|
||||
"description": "TypeScript SDK for Orama Network - Database, PubSub, Cache, Storage, Vault, and more",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user