Skip to content

Validation issue with optional fields #19

Closed

Description

@dubo-dubon-duponey

There is a "validation issue" (https://discord.com/channels/707636530424053791/796905486145683506/798725370219986966) that prevents any default value to be applied properly.

Below an example with exec, but this is true for any other

package test

#dagger: compute: [
    {
        do: "fetch-container"
        ref: "busybox"
    },
    {
        do: "exec"
        args: ["sh", "-c", """
            echo \(host) > /tmp/out
        """]
//                dir: "/"
    },
]

The output will be:

buildkit solve:  task failed: #Script.1: empty disjunction: 7 related errors:
#Script.1: field `dir` not allowed:

Expectation is that the optional "dir" can be omitted and would get the spec.cue default ("/").

Activity

  1. shykes commented on Jan 16, 2021

    @shykes
    Contributor

    I will work on a patch for this.

  2. added
    kind/bug
    on Jan 16, 2021
  3. added a commit that references this issue on Jan 21, 2021
  4. added a commit that references this issue on Apr 16, 2022
  5. added a commit that references this issue on Aug 24, 2023
  6. added a commit that references this issue on Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions