Skip to content

--input comes "too late" and cannot override default values #51

Closed

Description

@dubo-dubon-duponey

Consider the following:

foo: string | *"default foo"

and running:

dagger compute . --input 'foo: "lalal"'

Result:

2:15PM FTL failed to compute error="input.cue: foo: conflicting values \"lalal\" and \"default foo\""

"Naive" expectation would be that it would work fine, and that "foo" would evaluate as "lalal".

Activity

  1. aluzzardi commented on Jan 21, 2021

    @aluzzardi
    Contributor

    I think this might be related to #19?

  2. aluzzardi commented on Jan 26, 2021

    @aluzzardi
    Contributor

    This is actually related to #71.

    Currently, the env exports base, input and output as JSON, only to be merged back as Cue in the end.

    However, exporting to JSON is lossy, and the merge will fail.

    For instance,

    • base: lol: string | *"default lol" --> .JSON() --> {"lol":"default lol"}
    • --input 'lol: "hello"' --> .JSON() --> {"lol":"hello"}

    The merge between the two will end up failing.

    I'm expanding the scope of #71 to fix this as well.

  3. added this to the beta milestone on May 11, 2021
  4. added a commit that references this issue on May 23, 2023
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions