ComposeProject() is the bare application name (names.go:56), Container(workload, replica) is <app>-<workload>-<n> (names.go:187), and WorkloadVolume is ob_<app>_<workload>_<volume> (names.go:152). None carry the environment.
Meanwhile Environment.BasePath (types.go:71) is a per-environment override, and the host owner record is application-scoped (internal/engine/host_owner.go:69) — it compares owner != e.Spec.Name and nothing else. So pointing staging at production's server passes ownership, and passes preflight too, because preflight looks for foreign resources and these names are the application's own. The result is staging adopting production's containers and volumes while writing releases under a different base path.
The model is also inconsistent with itself: ProtectionTimerForEnvironment does carry the environment, and ProtectionTimer (the variant without it) is dead.
Either record the environment alongside the application in the host owner record and refuse a mismatch, or state one-environment-per-host as a documented constraint. Right now it is neither enforced nor written down.
Split out of #50 as item 6.
ComposeProject()is the bare application name (names.go:56),Container(workload, replica)is<app>-<workload>-<n>(names.go:187), andWorkloadVolumeisob_<app>_<workload>_<volume>(names.go:152). None carry the environment.Meanwhile
Environment.BasePath(types.go:71) is a per-environment override, and the host owner record is application-scoped (internal/engine/host_owner.go:69) — it comparesowner != e.Spec.Nameand nothing else. So pointingstagingat production's server passes ownership, and passes preflight too, because preflight looks for foreign resources and these names are the application's own. The result isstagingadopting production's containers and volumes while writing releases under a different base path.The model is also inconsistent with itself:
ProtectionTimerForEnvironmentdoes carry the environment, andProtectionTimer(the variant without it) is dead.Either record the environment alongside the application in the host owner record and refuse a mismatch, or state one-environment-per-host as a documented constraint. Right now it is neither enforced nor written down.
Split out of #50 as item 6.