Skip to content

[BUG] wash throws JSON error on deploy or validate due to malformed wadm.yaml #677

Description

@jonobattle
  • Moving this bug here after posting to wash-cli issues.

Describe the bug

When running wash app deploy ./wadm.yaml I received a

Unable to parse manifest: Json(Error("expected value", line: 1, column: 1))

No JSON is involved in my project so I ran the wadm app validate ./wadm.yaml and got:

failed to validate Wadm manifest

Caused by:
    0: failed to parse manifest content in file: ./wadm.yaml
    1: spec.components[0]: unknown field `properties`, expected one of `image`, `application`, `id`, `config`, `secrets` at line 9 column 7

Not a biggie, but the JSON error could send people in the wrong direction.

The error was caused by an empty "properties" object where I had commented out the links.

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: workflow
  annotations:
    description: "Workflow project"
spec:
  components:
    - name: workflow
      type: component
      properties:
        # To use the locally compiled code in this folder, use the line below instead after running `wash build`:
        image: file://./build/cardio_workflow.wasm
        # image: ghcr.io/wasmcloud/components/echo-messaging-rust:0.1.0
        id: workflow
        config:
          - name: workflow
        properties:
          #link_workflow_manifest: "bucket-workflow-manifest"
          #link_workflow_lock: "bucket-workflow-lock"
          #link_workflow_instance: "bucket-workflow-instance"

Steps to reproduce

Run wash app deploy ./wadm.yaml when you have an invalid yaml file like above (properties object has child props commented out).

Expected behavior

It would be great to see the output from the "validate" call rather than the JSON error.

Environment

  • PopOs
  • zsh
  • wash v0.41.0
    ├ nats-server v2.10.26
    ├ wadm v0.21.0
    └ wasmcloud v1.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions