dagger / dagger

An engine to run your pipelines in containers

Home Page:https://dagger.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐞 CLI args not parsed when secret env is not defined

skycaptain opened this issue Β· comments

What is the issue?

I have a module, where using credentials is optional, e.g.

import dagger
from dagger import function, object_type

@object_type
class Test:
    username: str | None = None
    token: dagger.Secret | None = None

    name: str | None = None

    @function
    def call(self) -> str:
        return f"Hello, {self.name}!"

When I call this module like this, I get a valid response:

$ MY_TOKEN="very_secret_variable" dagger call -m test --token=env:MY_TOKEN --name "World" call
Hello, World!

However, when token is missing, it seems that the CLI is stopping parsing the other arguments:

$ dagger call -m test --token=env:MY_TOKEN --name "World" call
Hello, None!

Dagger version

dagger v0.11.1 (registry.dagger.io/engine) darwin/arm64

Steps to reproduce

See above.

Log output

No response

That's an interesting find, thanks for reporting! πŸ€”