Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Formatting manifest replaces docker file with exo file #527

Open
BenElgar opened this issue Nov 18, 2021 · 1 comment
Open

[BUG] Formatting manifest replaces docker file with exo file #527

BenElgar opened this issue Nov 18, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@BenElgar
Copy link
Contributor

❯ cat docker-compose.yml
services:
  t0:
    image: bash
    command: "sleep infinity"
  t1:
    image: bash
    command: "sleep infinity"
    depends_on:
      - "t0"


❯ dexo manifest format docker-compose.yml

❯ cat docker-compose.yml
exo = "0.1"
components {
  network "default" {
    driver = "bridge"
    name   = "unnamed_default"
  }
  container "t0" {
    command        = "sleep infinity"
    container_name = "unnamed_t0_1"
    image          = "bash"
    labels         = { "com.docker.compose.project" = "unnamed", "com.docker.compose.service" = "t0" }
    networks       = ["unnamed_default"]
    _ {
      depends_on = ["default"]
    }
  }
  container "t1" {
    command        = "sleep infinity"
    container_name = "unnamed_t1_1"
    depends_on     = ["t0"]
    image          = "bash"
    labels         = { "com.docker.compose.project" = "unnamed", "com.docker.compose.service" = "t1" }
    networks       = ["unnamed_default"]
    _ {
      depends_on = ["default", "t0"]
    }
  }
}

❯ dexo manifest format docker-compose.yml
Error: yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `exo = "...` into compose.Project

Error: invalid manifest
invalid manifest

@BenElgar BenElgar added bug Something isn't working needs triage Incoming request that needs to be triaged and prioritized labels Nov 18, 2021
@brandonbloom
Copy link
Member

D'oh - more issues with this not-intended-to-be-released-yet format command :)

This one is because the only output format supported is exo.hcl, which is clearly a problem when the output file is the same as the input file with a different format.

A potential workaround is to use the redirection form:

exo manifest format < docker-compose.yml

This is similar to exo manifest convert with the output format will always as "exo.hcl", which isn't what you want if you're trying to format a compose yaml file, but we don't support that yet anyway.

@brandonbloom brandonbloom removed the needs triage Incoming request that needs to be triaged and prioritized label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants