Skip to content

Runtime names carry no environment, and nothing guards two environments on one host #58

Description

@vishr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions