I am trying to provide the app-spec for each deployment via the doctl apps update <app-id> --spec app-production.yml
command.
This way I was trying to solve following behaviour:
cors
settings in the app.yml and upload it in the control panelcors
settings are lost and the app.yml
seems to be “resetted”By providing the app.yml
during the CI pipeline I was trying to avoid inconsistencies or unexpected behaviour.
However, when I download the spec from the control panel (the exact same spec that is working and deployed) and try to provide it via the doctl apps update
command it fails with:
Error: parsing app spec: json: unknown field "allow_headers"
The spec looks roughly like this:
databases:
- engine: PG
name: db
num_nodes: 1
size: db-s-dev-database
version: "12"
domains:
- domain: XXX
type: PRIMARY
zone: XXX
name: core
region: fra
services:
- cors:
allow_headers:
- '*'
allow_methods:
- GET
- OPTIONS
- POST
- PUT
- PATCH
- DELETE
allow_origins:
- exact: YXZ
envs:
- key: DATABASE_URL
scope: RUN_TIME
value: ${db.DATABASE_URL}
- key: DB_HOST
scope: RUN_AND_BUILD_TIME
value: XXX
- key: DB_PORT
scope: RUN_AND_BUILD_TIME
value: "25060"
- key: DB_USER
scope: RUN_AND_BUILD_TIME
value: db
- key: DB_PASSWORD
scope: RUN_AND_BUILD_TIME
value: XXX
- key: DB_DATABASE
scope: RUN_AND_BUILD_TIME
value: db
- key: DB_SSL
scope: RUN_AND_BUILD_TIME
value: "yes"
- key: SENDING_MAIL
scope: RUN_AND_BUILD_TIME
value: XXX
- key: RECEIVING_MAIL
scope: RUN_AND_BUILD_TIME
value: XXX
- key: SECRET
scope: RUN_AND_BUILD_TIME
value: XXX
http_port: 80
image:
registry_type: DOCR
repository: core
tag: latest
instance_count: 1
instance_size_slug: basic-xs
name: core
routes:
- path: /
run_command: bash -c "uvicorn api:app --host 0.0.0.0 --port 80"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @WazzMaxx,
What version of
doctl
are you using? Support for the new CORS policy fields was only added in the most recent release, v1.61.0.Naturally, I am wondering: How can it be that a spec that I am using in the control panel (and that is obviously working) does not pass the parsing stage of the command line? Thanks in advance for your efforts, suggestions and answers :)