#SDK
1 messages · Page 1 of 1 (latest)
Noted. Yeah, I'm on 0.15.1. Mind sharing the error?
It is trying to pull your images on ghcr using the tag of the local Dagger engine version. So something along the lines of "cannot find image with tag 0.15.2".
@distant phoenix Fixed. And I added a version-specific tag. dagger init --sdk=https://github.com/m-pixel/dagger/sdk/dotnet/module@dotnet0.15.2
Awesome, thanks, will definitely try it out.
That worked, yay!
Even got my own daggerverse module installed and put into use.
However, cannot figure out how to set default values for builtins - e.g. Directory.
I should have included a Directory example in the template code.
You're looking for [DirectoryFromContext]. It's hierarchical:
// This sucks
public class MyMod
{
public string Echo([DirectoryFromContext(DefaultPath = "/messages")] Directory messagesToEcho) => ...;
public Container CurryEcho([DirectoryFromContext(DefaultPath = "/messages")] Directory messagesToEcho) => ...;
}
// This is better
[DirectoryFromContext(DefaultPath = "/messages")]
public class MyMod
{
public string Echo([DirectoryFromContext] Directory messagesToEcho) => ...;
public Container CurryEcho([DirectoryFromContext] Directory messagesToEcho) => ...;
}
You can set defaults at the assembly, class, function, and parameter level. And you can override either property (path, ignores) at each level.
For string, int, etc, set default values by setting default values:
public class MyMod
{
// Dagger will treat bar as optional, having a default value of "baz"
public void Foo(string bar = "baz") => ...;
}
Awesome, thanks.
@dense grove Would it be a bother to upgrade to 0.15.3?
Want to try it out again, but too much time would go with updating if I were to do it.