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

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

Closed
FillZpp opened this issue Jun 30, 2020 · 6 comments
Closed

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

FillZpp opened this issue Jun 30, 2020 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@FillZpp
Copy link
Contributor

FillZpp commented Jun 30, 2020

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?

@FillZpp
Copy link
Contributor Author

FillZpp commented Jun 30, 2020

/kind bug

@cbandy
Copy link

cbandy commented Jul 15, 2020

To me, the validation of core types is a feature rather than a bug. Without it, I would have to implement a validating webhook to verify core types, yes? There are some limitations (declarative defaults, #444) and possibly bugs, but those should be fixed upstream on the core types rather than here.

I see that PersistentVolumeClaimSpec.DataSource has always been tagged +optional, so perhaps that is a bug in this project.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 13, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 12, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants