Skip to content

Incorrect crd properties generated for structs defined in k8s/api #457

Closed
@FillZpp

Description

@FillZpp

Hi folks,

we define CRD with fields defined in k8s.io/api, such as:

import (
    v1 "k8s.io/api/core/v1"
)

type CloneSetSpec struct {
    // ...
    Template v1.PodTemplateSpec `json:"template"`
    // ...
    VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
}

For this kind:

Problems we have found:

  1. For VolumeClaimTemplates []v1.PersistentVolumeClaim, it requires user to define dataSource in v1.PersistentVolumeClaim, which should be optional. (Issue)
  2. For Template v1.PodTemplateSpec, it will return The CloneSet "demo" is invalid: type: Required value when we define downwardAPI in template.spec.volumes.

So, could we skip to generate properties for structs defined in k8s.io/api, just like the v0.1.x did?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions