deref / exo

A process manager & log viewer for dev
https://exo.deref.io
Apache License 2.0
413 stars 17 forks source link

[BUG] Manifest allows components with the same name #537

Open BenElgar opened 2 years ago

BenElgar commented 2 years ago

This is a manifest that is apparently valid and is successfully applied:

exo = "0.1"
components {
  container "t0" {
    image = "bash"
    command = "sleep infinity"
  }
  container "t0" {
    image = "alpine"
    command = "sleep infinity"
  }
}

In practice this seems to consistently run the bash container:

❯ dexo apply
Job URL: http://localhost:44643/#/jobs/8kjz638hb3838jwdhspg5ctqsm
applying
✓ ├─ deleting t0
✓ └─ re-creating t0

❯ docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS          PORTS     NAMES
72b76bf1e65f   8856ae160078   "docker-entrypoint.s…"   25 seconds ago   Up 24 seconds             focused_proskuriakova

❯ docker inspect 8856ae160078 | jq '.[0].RepoTags'
[
  "bash:5",
  "bash:latest"
]
brandonbloom commented 2 years ago

Yeah, we should definitely reject this!

brandonbloom commented 2 years ago

This should be resolved in #543 by virtue of Cue's unification logic.