[client] Move the MDM precedence into ResolveUploadURL

Three of the four bundle paths ordered the destinations themselves, each with
its own copy of "MDM first, then what was asked for". Give the resolver the MDM
value as its first argument so the order lives in one place and a call site
cannot express a different one.

Pure refactor: the daemon passes "" for now, matching what it does today, and
the remote job and both mobile SDKs resolve exactly as before.
This commit is contained in:
riccardom
2026-09-25 13:34:17 +02:00
parent c3993bef73
commit b3ee6c9af2
6 changed files with 52 additions and 24 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ func (c *Client) DebugBundle(anonymize bool, anonymizeLevel string) (string, err
// An MDM override wins; otherwise the destination this deployment publishes
// is used, and failing that the service NetBird runs.
uploadURL := debug.ResolveUploadURL(cfg.DebugBundleUploadURL, publishedUploadURL)
uploadURL := debug.ResolveUploadURL(cfg.DebugBundleUploadURL, "", publishedUploadURL)
path, err := bundleGenerator.Generate()
if err != nil {