Duplicate declarations in generated Go package #104
Labels
area/codegen
Affects quality or correctness of generated code
area/schema
Related to support for CRD or Pulumi schema support
kind/bug
Some behavior is incorrect or out of spec
resolution/fixed
This issue was fixed
What happened?
Hello, I have a problem with crd2pulumi -
I have generated from the following crd - https://github.com/argoproj/argo-rollouts/blob/master/manifests/crds/rollout-crd.yaml - a pulumi package using the above command, and I got errors in the pulumiTypes.go file!
When I am running pulumi up, I get the following error message:
argoRollout/argoproj/v1alpha1/pulumiTypes.go:1842:6: RolloutSpecStrategyBluegreenPostpromotionanalysisArgs redeclared in this block argoRollout/argoproj/v1alpha1/pulumiTypes.go:1674:6: other declaration of RolloutSpecStrategyBluegreenPostpromotionanalysisArgs argoRollout/argoproj/v1alpha1/pulumiTypes.go:1917:98: v.Name undefined (type RolloutSpecStrategyBluegreenPostpromotionanalysisArgs has no field or method Name) argoRollout/argoproj/v1alpha1/pulumiTypes.go:1921:99: v.Value undefined (type RolloutSpecStrategyBluegreenPostpromotionanalysisArgs has no field or method Value) argoRollout/argoproj/v1alpha1/pulumiTypes.go:1926:12: v.ValueFrom undefined (type RolloutSpecStrategyBluegreenPostpromotionanalysisArgs has no field or method ValueFrom) argoRollout/argoproj/v1alpha1/pulumiTypes.go:2719:6: RolloutSpecStrategyBluegreenPrepromotionanalysisArgs redeclared in this block argoRollout/argoproj/v1alpha1/pulumiTypes.go:2551:6: other declaration of RolloutSpecStrategyBluegreenPrepromotionanalysisArgs argoRollout/argoproj/v1alpha1/pulumiTypes.go:2794:97: v.Name undefined (type RolloutSpecStrategyBluegreenPrepromotionanalysisArgs has no field or method Name) argoRollout/argoproj/v1alpha1/pulumiTypes.go:2798:98: v.Value undefined (type RolloutSpecStrategyBluegreenPrepromotionanalysisArgs has no field or method Value) argoRollout/argoproj/v1alpha1/pulumiTypes.go:4104:6: RolloutSpecStrategyCanaryAnalysisArgs redeclared in this block argoRollout/argoproj/v1alpha1/pulumiTypes.go:3926:6: other declaration of RolloutSpecStrategyCanaryAnalysisArgs argoRollout/argoproj/v1alpha1/pulumiTypes.go:5841:6: RolloutSpecStrategyCanaryStepsAnalysisArgs redeclared in this block argoRollout/argoproj/v1alpha1/pulumiTypes.go:5673:6: other declaration of RolloutSpecStrategyCanaryStepsAnalysisArgs argoRollout/argoproj/v1alpha1/pulumiTypes.go:6813:6: RolloutSpecStrategyCanaryStepsExperimentAnalysesArgs redeclared in this block argoRollout/argoproj/v1alpha1/pulumiTypes.go:6712:6: other declaration of RolloutSpecStrategyCanaryStepsExperimentAnalysesArgs argoRollout/argoproj/v1alpha1/pulumiTypes.go:2798:98: too many errors
I am taking from this that the crd2pulumi couldn’t create the package from the crd correctly.
Steps to reproduce
crd2pulumi --goName argoRollout --goPath ./argoRollout ./rollout-crd.yaml
Expected Behavior
The files generated are without duplicated declarations (specifically the pulumiTypes.go)
Actual Behavior
The files generated are with duplicated declarations (specifically the pulumiTypes.go)
Output of
pulumi about
CLI
Version 3.37.2
Go Version go1.18.4
Go Compiler gc
Plugins
NAME VERSION
aws 5.13.0
gcp 6.34.0
go unknown
kubernetes 3.20.4
random 4.8.1
Host
OS darwin
Version 12.1
Arch arm64
This project is written in go: executable='/usr/local/go/bin/go' version='1.18.5 darwin/amd64'
Additional context
No response
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).
The text was updated successfully, but these errors were encountered: