Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate from Contour CRDs #105

Closed
roderik opened this issue Dec 23, 2022 · 5 comments · Fixed by #136
Closed

Cannot generate from Contour CRDs #105

roderik opened this issue Dec 23, 2022 · 5 comments · Fixed by #136
Assignees
Labels
area/codegen Affects quality or correctness of generated code impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@roderik
Copy link

roderik commented Dec 23, 2022

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/v3@v3.43.1/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/v3@v3.43.1/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/cobra@v1.5.0/command.go:872 +0x4d0
github.com/spf13/cobra.(*Command).ExecuteC(0x14000b85680)
	/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.5.0/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).

@roderik roderik added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 23, 2022
@roderik
Copy link
Author

roderik commented Dec 24, 2022

FYI, removing the status section in HTTP Proxy solved it for this CRD

@mikhailshilkov mikhailshilkov added area/codegen Affects quality or correctness of generated code and removed needs-triage Needs attention from the triage team labels Dec 27, 2022
@samox73
Copy link

samox73 commented Feb 23, 2023

@valkum
Copy link

valkum commented Mar 6, 2023

Also caused by https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.6.1/standard-install.yaml

@caioaao
Copy link

caioaao commented May 18, 2023

looks like a duplicate of #61

@EvanBoyle EvanBoyle added the impact/panic This bug represents a panic or unexpected crash label Jul 3, 2023
@blampe blampe closed this as completed in 13bd703 May 14, 2024
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label May 14, 2024
@pulumi-bot
Copy link

This issue has been addressed in PR #136 and shipped in release v1.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen Affects quality or correctness of generated code impact/panic This bug represents a panic or unexpected crash kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants