-
Notifications
You must be signed in to change notification settings - Fork 718
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
Create CRDs V1 #2184
Create CRDs V1 #2184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went relatively quickly on all the files, played a little with grep -r
, generated and applied all-crds.yml and everything seems ok.
I've the same concerns about the webhook but let's merge this PR and fix them if needed after to avoid too many "conflicts fix".
LGTM!
API docs generation does not produce a consistent order, which messes up with CI:
I'll see what I can do here. |
That's odd. It should produce output sorted by the API name and version. Let me know if you need any help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the following:
- Apply all-in-one with v1beta1
- Deploy an Elasticsearch instance
- Apply all-in-one with v1
I have the following error:
"error":"Object default/elasticsearch-sample-es-http-certs-internal is already owned by another Elasticsearch controller elasticsearch-sample"
Is it related to the one you got yesterday ?
elastic/gen-crd-api-reference-docs#1 should fix the inconsistent api docs rendering. |
@barkbay I get the same error you get, probably because the operator with CRD v1 is trying to add The corresponding code in controller-runtime does a strict comparison between both resource versions: for i, r := range existingRefs {
if referSameObject(ref, r) {
fi = i
} else if r.Controller != nil && *r.Controller {
return newAlreadyOwnedError(object, r)
}
} func referSameObject(a, b metav1.OwnerReference) bool {
aGV, err := schema.ParseGroupVersion(a.APIVersion)
if err != nil {
return false
}
bGV, err := schema.ParseGroupVersion(b.APIVersion)
if err != nil {
return false
}
return aGV == bGV && a.Kind == b.Kind && a.Name == b.Name
} I created an issue in the controller-runtime repository: kubernetes-sigs/controller-runtime#699. |
I found another blocker for this: #2192 |
#2211 should fix the owner reference problem. |
👏👏👏 should make refactors easier in the future |
#2217 should fix the StatefulSet volumeClaimTemplates problem. |
The PR is ready for another round of reviews. The only thing I'm not sure about is the webhook. I created a follow-up issue so it does not delay this PR. |
Maybe I am doing something silly here, that I am not aware of, but when I run the operator based on this PR I see errors on my existing
Update: so it looks like it is failing on the status subresource update (we are sending |
@pebrc hm right I did not retest APM. Will look into it, thanks for testing! |
We discussed the bug offline with @pebrc:
I'm extracting this to its own issue. |
The status subresource validation error is now fixed with #2229. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (I did not retest but assume we are good now)
Jenkins test this please. |
Bump the current v1beta1 CRD to a separate v1 CRD with the exact same content. As such, it's fine to rely on the OpenAPI validation schema of the v1 version to validate the v1beta1 resources. I tried to make sure every single reference we had to the v1beta1 API is updated to use the v1 API now. Along with that change I tried to homogenize the imports so we always import esv1, kbv1, etc. instead of using a mix of estype, esv1beta1, elasticsearchv1beta1, v1beta1, etc. * Add v1 API codebase * Unset storage version for v1beta1 resources * Fix Elasticsearch webhook path * Regenerate CRDs with v1 version * Regenerate webhook manifests with v1 webhook * Use v1 APIs in the entire codebase & homogenize imports * Adapt golangci exceptions to v1 apis * Use v1 CRD in samples * Regenerate API docs to cover v1 crds * Default to using crd v1 in the documentation * Fix typo: corev1 * Regenerate api docs with the fixed version with sorting
Bump the current
v1beta1
CRD to a separatev1
CRD with the exact same content. As such, it's fine to rely on the OpenAPI validation schema of the v1 version to validate the v1beta1 resources.I tried to make sure every single reference we had to the v1beta1 API is updated to use the v1 API now. Along with that change I tried to homogenize the imports so we always import
esv1
,kbv1
, etc. instead of using a mix ofestype
,esv1beta1
,elasticsearchv1beta1
,v1beta1
, etc.Commit messages show high-level changes.
I made sure the webhook for v1 works fine with the all-in-one version, but I have some doubts on:
I'll investigate and maybe fix them in a follow-up PR.
Fixes #2117.