Skip to content

allow container address in default pragrams and customizations - #11714

Merged
kpenfound merged 10 commits into
dagger:mainfrom
kpenfound:defaultable_containers
Jan 27, 2026
Merged

kpenfound merged 10 commits into
dagger:mainfrom
kpenfound:defaultable_containers

Conversation

@kpenfound

@kpenfound kpenfound commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

This lets you do

// +defaultAddress="alpine:latest"
ctr *dagger.Container,

and

{
  "function": ["testWithDefaultContainer"],
  "argument": "ctr",
  "defaultAddress": "alpine:3.18"
}

in json.

Added lots of tests so hopefully this isn't a terrible idea.

In making this I discovered that our documentation for python constructors with complex types has been wrong all along, so I've corrected that too.

Fixes #8483

@kpenfound
kpenfound requested a review from a team as a code owner January 16, 2026 22:21
@kpenfound

kpenfound commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Question to follow up on from @shykes : Why does this work with +default when we had to use +defaultPath for context directories? Need to dig up the context on that. Maybe this should be +defaultAddress instead. Or if the original restriction is no longer valid, should +defaultPath become +default?

@kpenfound

Copy link
Copy Markdown
Contributor Author

Also need to update the typescript test to match the others

@eunomie

eunomie commented Jan 16, 2026

Copy link
Copy Markdown
Member

I don't remember why defaultPath, IIRC there's a good reason we can't get ride of it.
So in that spirit it can make sense to have something like defaultAddress.
But default is good too, and I like it, it can help to make some function smoother.

@kpenfound
kpenfound requested review from a team as code owners January 26, 2026 22:14
@kpenfound

Copy link
Copy Markdown
Contributor Author

Changed to +defaultAddress to separate the discussion on just using +default for everything

@kpenfound

Copy link
Copy Markdown
Contributor Author

Created this issue for discussion: #11745

@eunomie eunomie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Just added two comments, but just regarding tests

Comment thread core/integration/module_go_test.go Resolved
Comment thread core/integration/module_python_test.go Resolved
@kpenfound
kpenfound merged commit 61c91e2 into dagger:main Jan 27, 2026
2 checks passed
@kpenfound
kpenfound deleted the defaultable_containers branch January 27, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default value for Container arguments

2 participants