Skip to content

fix(deploy): make the Route host/domain/path overrides take effect - #5425

Merged
norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:fix/deploy-route-overrides
Jun 5, 2026
Merged

fix(deploy): make the Route host/domain/path overrides take effect#5425
norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:fix/deploy-route-overrides

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Problem

The deploy-from-Git/file wizard's Route section collects host, domain and path, but they were dead:

  • cf CLI v8 dropped the host/domain manifest attributes in favour of routes:. The push reads a specific route only from the manifest (there is no host/domain push flag), and the manifest file was never rewritten between fetch and push — so host/domain were silently discarded.
  • The path field was additionally mis-wired to cf push's source -p flag, and then overwritten by the fetched source directory — so it did nothing in the normal case and set a bogus filesystem path in the docker case.

Fix

Compose host + domain + path into a single routes: entry (host.domain/path) and write it into the manifest before the push parses it, using the cf v8 manifestparser for the round-trip so that fields the parser does not model (processes, sidecars, metadata, services, …) survive via its inline RemainingManifestFields map.

Semantics:

  • Override-wins: the composed route replaces the first application's route set (consistent with how every other field in this step overrides the manifest) and strips the deprecated host/hosts/domain/domains/no-hostname keys, which cf v8 rejects alongside routes:.
  • Left untouched when no-route/random-route is set (those are push flags; the wizard disables the address fields in those modes, so leaked values must not become a route) or when no route can be composed (a host/path with no domain to attach to).

Backend-only — the frontend already ships host/domain/path in the overrides payload; nothing in the UI changes.

Testing

  • New route_override_test.go — 13 cases: route composition table (host/domain/path, apex domain, leading-slash normalisation, host-only/path-only → no route); convert + strip-deprecated + preserve-unmodeled-keys; domain-only; path folding; and no-route / random-route / no-override / host-only all leaving the manifest byte-for-byte unchanged.
  • go build, go vet, full cfapppush package suite green.

Closes #5400 — the final remaining item of the deploy-from-Git wizard usability/correctness issues (the other items landed previously).

The deploy wizard's Route section collected host, domain and path but
they were dead. cf CLI v8 dropped the host/domain manifest attributes
in favour of `routes:`, the push reads a specific route only from the
manifest, and the manifest file was never rewritten between fetch and
push. The path field was additionally mis-wired to cf push's source
`-p` flag (and then overwritten by the fetched source dir).

Compose host+domain+path into a `routes:` entry and write it into the
manifest, via the v8 manifestparser so unmodeled keys (processes,
sidecars, metadata, ...) survive, before the push parses it.
Override-wins: it replaces the application's route set and strips the
deprecated host/hosts/domain/domains/no-hostname keys, which cf v8
rejects alongside `routes:`. The manifest is left untouched when
no-route/random-route is set or no route can be composed.

Closes cloudfoundry#5400 (Host/Domain overrides item).

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@norman-abramovitz
norman-abramovitz merged commit ee0b8fa into cloudfoundry:develop Jun 5, 2026
12 checks passed
@nabramovitz
nabramovitz deleted the fix/deploy-route-overrides branch June 5, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy-from-Git wizard: usability & correctness issues

2 participants