Since I upgraded to this version, enums are not working as before.
Before
with
// Main `New` function
func New(
// ...
// +optional
version KsVersion,
// ...
) // ...
// Enum definition
type KsVersion string
const (
v1_30 KsVersion = "v1_30"
v1_31 KsVersion = "v1_31"
v1_32 KsVersion = "v1_32"
v1_33 KsVersion = "v1_33"
)
// And a function
func Foo(version KsVersion) //...
The options to pass to the enum were the values, that in this case are the same as the vars names (i.e. dagger call --version v1_30)
Now
with the same as before the options are: one of V_1_30,V_1_31,V_1_32,V_1_33, this are the vars names, but not as they were defined
After realising the previous behaviour, I just changed the value for version in my workflow.
Now the thing is, in my module (kind), which defines the enum, it works perfectly. But I have another module (validate-crds) that depends in the first one that gives me the following error:
┆ ): Directory!
┆ version: V_1_31
): ValidateCrds! 0.2s ERROR
panic: failed to unmarshal input arg version: unknown enum value "v1_31"
goroutine 1 [running]:
main.invoke({0x8f2e80, 0x400
This happens with this command: dagger call --version V_1_31 .....
The dependency is installed as a local module:
"dependencies": [
{
"name": "kind",
"source": "../kind"
}
]
I call the kind module like this:
opts := dagger.KindOpts{}
if version != "" {
opts.Version = version
}
container := dag.Kind(dockerSocket, kindSvc, opts).Container()
Why could this be happening?