crd2pulumi
crd2pulumi copied to clipboard
Cannot generate from Contour CRDs
What happened?
Trying to use HTTPProxies from Contour
Steps to reproduce
crd2pulumi --nodejsPath ./contour -n --nodejsName contour https://raw.githubusercontent.com/projectcontour/contour-operator/f8c07498803d062e30c255976270cbc82cd619b0/config/crd/bases/operator.projectcontour.io_contours.yaml
Expected Behavior
it works ;)
Actual Behavior
panic: fatal: error An assertion has failed: could not parse Pulumi package. source error: could not import spec: <nil>: #/types/kubernetes:operator.projectcontour.io%2Fv1alpha1:ContourSpec/properties/namespace/default: type kubernetes:operator.projectcontour.io/v1alpha1:ContourSpecNamespace cannot have a constant value; only booleans, integers, numbers and strings may have constant values; , and 11 other diagnostic(s)
goroutine 1 [running]:
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)
/Users/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/failfast.go:23
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.AssertNoErrorf({0x1040f3040?, 0x14000566ac0?}, {0x1036fb7e7?, 0x14000739b00?}, {0x0?, 0x1022df874?, 0x1400098c200?})
/Users/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/assert.go:47 +0x110
github.com/pulumi/crd2pulumi/pkg/codegen.(*PackageGenerator).SchemaPackage(0x14000400a80)
/Users/runner/work/crd2pulumi/crd2pulumi/pkg/codegen/packagegenerator.go:108 +0x74
github.com/pulumi/crd2pulumi/pkg/codegen.GenerateNodeJS(0x1036cd9dd?, {0x16db5ef92, 0x7})
/Users/runner/work/crd2pulumi/crd2pulumi/pkg/codegen/nodejs.go:33 +0x34
github.com/pulumi/crd2pulumi/pkg/codegen.Generate(0x14000180460, {0x14000564720, 0x1, 0x1})
/Users/runner/work/crd2pulumi/crd2pulumi/pkg/codegen/codegen.go:61 +0x208
github.com/pulumi/crd2pulumi/pkg/codegen.GenerateFromFiles(0x0?, {0x140000b5080, 0x1, 0x0?})
/Users/runner/work/crd2pulumi/crd2pulumi/pkg/codegen/codegen.go:38 +0x6c
github.com/pulumi/crd2pulumi/cmd.Execute.func3(0x14000b85680?, {0x140000b5080?, 0x1, 0x6})
/Users/runner/work/crd2pulumi/crd2pulumi/cmd/root.go:97 +0x1d8
github.com/spf13/cobra.(*Command).execute(0x14000b85680, {0x140001b0010, 0x6, 0x6})
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:872 +0x4d0
github.com/spf13/cobra.(*Command).ExecuteC(0x14000b85680)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/pulumi/crd2pulumi/cmd.Execute()
/Users/runner/work/crd2pulumi/crd2pulumi/cmd/root.go:134 +0x670
main.main()
/Users/runner/work/crd2pulumi/crd2pulumi/main.go:25 +0x20
Output of pulumi about
CLI
Version 3.50.2
Go Version go1.19.4
Go Compiler gc
Host
OS darwin
Version 13.2
Arch arm64
Backend
Name pulumi.com
URL https://app.pulumi.com/roderik
User roderik
Organizations roderik, settlemint
Pulumi locates its logs in /var/folders/8k/dr7tcy11347cq606ctpfxmyr0000gn/T/ by default
Additional context
crd2pulumi version
v1.2.3
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
FYI, removing the status section in HTTP Proxy solved it for this CRD
same problem with postgres-operator crd:
https://raw.githubusercontent.com/zalando/postgres-operator/v1.9.0/manifests/operatorconfiguration.crd.yaml
Also caused by https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.6.1/standard-install.yaml
looks like a duplicate of #61