Skip to content

Schema generation fails for CRD containing oneOf constraint #131

@eric-carlsson

Description

@eric-carlsson

What happened?

When attempting to add a CRD dependency containing oneOf constraints, I got an error:

crossplane: error: failed to generate go code from OpenAPI schema: error generating type definitions: error 
generating code for type definitions: duplicate typename 'IoCiliumV2CiliumClusterwideNetworkPolicySpec0' 
detected, can't auto-rename, please use x-go-name to specify your own name for one of them

Upon stripping the corresponding oneOf constraints, schema generation works. The CRD contains other fields with similar constraints, so this doesn't affect all such constraints.

How can we reproduce it?

I received this error when attempting to add Cilium CRDs as a dependency:

crossplane dependency add https://github.com/cilium/cilium --git-ref=main --git-path=pkg/k8s/apis/cilium.io/client/crds

What environment did it happen in?

  • Crossplane CLI version: v2.3.0
  • Platform (e.g., linux/amd64): darwin/arm64
  • Crossplane version (if applicable): N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions