By WazzMaxx
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!
Accepted Answer
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.
$ doctl version
doctl version 1.61.0-release
Git commit hash: c46d9619
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 :)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.