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

Structured-merge-diff support #1081

Closed
erictune opened this issue Oct 7, 2019 · 13 comments
Closed

Structured-merge-diff support #1081

erictune opened this issue Oct 7, 2019 · 13 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@erictune
Copy link

erictune commented Oct 7, 2019

I want KubeBuilder to support these comment tags:

// +listMapKey=XXX
// +listType=atomic
// +listType=set
// +listType=map

These are supported by https://github.com/kubernetes/kube-openapi (see here ) and I believe they are supported by Server-side apply for CRDs in 1.16.

KubeBuilder should be able to emit these properties when generating CRDs.

Related issues:

Requires 1.16

/kind feature

@erictune erictune added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 7, 2019
@erictune
Copy link
Author

erictune commented Oct 7, 2019

Note that uses who are currently referring to code which uses these tags already, such as in pod templates within custom controllers, will see a change to their generated CRD when they upgrade their KubeBuilder version.

Need to determine how to explain this to users.

To do that, need to understand what will happen.
kubernetes-sigs/structured-merge-diff#115 is about that.

@DirectXMan12
Copy link
Contributor

Does the actual desierialization of CRD validation schemas support it yet? IIRC, that was the blocker.

@DirectXMan12
Copy link
Contributor

otherwise, yeah, we should open an issue in controller-tools for this

@apelisse
Copy link

apelisse commented Oct 7, 2019

I think it's been done in 1.16. Let me double-check that.

@apelisse
Copy link

apelisse commented Oct 7, 2019

@apelisse
Copy link

apelisse commented Oct 7, 2019

@apelisse
Copy link

apelisse commented Oct 7, 2019

cc @jennybuckley

@jennybuckley
Copy link

Yes. This is done in 1.16 so this is no longer blocked

@DirectXMan12
Copy link
Contributor

cool, we should cross-file on CT then

@droot
Copy link
Contributor

droot commented Oct 18, 2019

I am wondering how we can do a better job of educating the users about using these markers when they use a list in their API definition. One idea that comes to mind is some sort of linter command in controller-tools that give tips to users when we encounter a field of list-type that doesn't have these markers specified.

@apelisse
Copy link

(btw, I'm working on the implementation right now)
/assign

Yes, I'm trying to look at the documentation holistically right now, there are lots of gaps in that area. Making it obvious to CRD authors that this is a thing would help by calling out this specifically in CRD docs (I'm also working on this).

A fairly obvious way to make a linter is to find specific patterns (@pwittrock already used that principle) like search for lists that have a field name, etc. You could also search for map[string]substructure which is another common pattern. I'm clearly not opposed to the idea.

@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 Jan 16, 2020
@apelisse
Copy link

This was absolutely fixed by kubernetes-sigs/controller-tools#347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

7 participants