acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.13k stars 100 forks source link

Unable to set environment/env for service(consuming) #2339

Closed randall-coding closed 10 months ago

randall-coding commented 10 months ago

When I try to set the environment field as per the docs, I see the following errors on acorn build

✗ ERROR: schema violation types.App.services.db: option 1: [must match alternate (:123:16)], option 2: [option 1: [must match alternate (:108:20)], option 2: [unknown field: types.ServiceGeneric.environment (:78:18)], option 3: [unknown field: types.ServiceGenerated.container (:108:20)]], option 3: [unknown field: types.ServiceAcorn.container (:123:16)]

✗ ERROR: schema violation types.App.services.db: option 1: [must match alternate (:123:16)], option 2: [option 1: [must match alternate (:108:20)], option 2: [unknown field: types.ServiceGeneric.env (:78:18)], option 3: [unknown field: types.ServiceGenerated.container (:108:20)]], option 3: [unknown field: types.ServiceAcorn.container (:123:16)]

Here is my Acornfile:

containers: {
    website: {
        image: "gamelaster/opensupports:latest"
        ports: publish: [
            "80/http"
        ]
        env: {
            TIMEZONE: "secret://env/timezone"
        }
        dirs: {
            "/config": "volume://config"
        }
        dependsOn: ["mariadb"]
    }
}
services: db: {
    default:   true
    container: "mariadb"
    secrets: ["admin", "user"]
    ports: "3306"
    env: {ABC: "XYZ"} // Error on this field.  env or environment.  
    data: dbName: "instance"
}
//...secrets, volumes
randall-coding commented 10 months ago

Nevermind I think I see my error on this issue. Will try again.