nais / naisd

nais deployment daemon
https://nais.io
MIT License
27 stars 10 forks source link

Improve error messaging when unable to unmarshal nais.yaml #81

Closed gtcno closed 6 years ago

gtcno commented 6 years ago

We hide marshaling errors here:

https://github.com/nais/naisd/blob/1c05413b58d9f397a78474436abd4e56bdc82828/api/manifest.go#L146

Kyrremann commented 6 years ago

This has been fixed.

The following manifest:

name: nais-testapp
image: navikt/nais-testapp 
port: 8080
prometheus:
  enabled: true
  path: /metrics
preStopHookPath: "/die"
fasitResources:
  used:
  - alias: testCredential
    resourceType: credential
  - alias: a.testBaseurl
    resourceType: baseurl
  - alias: testCertificate
    resourceType: certificate
  - alias: testCertificate2
    resourceType: certificate
leaderElection: true
  can@t marshall thi's
redis: lame
istio:
  enabled: true

gives the following error:

[13:50:48][nais-dev:~] ~$ curl -k -d '{"application": "nais-testapp", "version": "37.0.0", "fasitEnvironment": "ci", "zone": "fss", "fasitUsername": "'"${USER}"'", "fasitPassword": "'"${PASSWORD}"'", "manifestURL": "'"${MANIFEST_URL}"'"}' https://daemon.nais-ci.devillo.no/deploy
unable to generate manifest/nais.yaml: 1 error occurred:

* unable to unmarshal yaml: unmarshal errors:
  line 18: cannot unmarshal !!str `true ca...` into bool
  line 20: cannot unmarshal !!str `lame` into bool from URL: https://gist.githubusercontent.com/Kyrremann/1dafaa15e21f5a1164becfa0a9430770/raw/20ee2ac4ff94a4d2d56edd7f5fe03c22d9be0504/test-app.nais.yaml (500)