-
Notifications
You must be signed in to change notification settings - Fork 44
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
Strimzi-Kafka-Operator Bug - Missing Schema Validation #286
Comments
WoWWWW |
Great work @MarkintoshZ ! I am wondering if it is possible to minimize the CR to reproduce this bug? It would greatly help developers spot the triggering condition. By the way, have you tried to validate if the proposed fix would fix this bug? |
@MarkintoshZ I made some small edits to the report. Feel free to report to developers. |
Great! I'll post it now. |
It would be best if you can submit a fix PR after you report this issue, you can research a bit on how to add CRD schema validation for Java operators -- these CRDs are typically auto-generated in these big operator repos, so you would likely need to modify some code to add this validation rule to the auto-generation process. |
For reference, Golang operators' validation rules are added by writing markers in the comments: https://book.kubebuilder.io/reference/markers.html You can check if the Java CRD generator has similar mechanism |
Posted here. They are using a issues template so the formatting and layout is a little different. I'll look into adding schema validation for the java CRD generator. |
@MarkintoshZ I remember you mentioned that you found two bugs? How is the other bug? |
Could you also update this file? |
@tianyin The other one is a false positive alarm due to premature identification of system convergence. |
Is it a bug in the Acto code? |
No it should be fixed by extending the timeout in the config file. I think there might be more bugs in the operator that we could find by making improvement to how we are identifying error-state and how schema matching is currently done with the java operator. I will write down the ideas in #274 and do another Acto run sometime soon |
I close the issue as it is reported. I will leave #274 open. |
Work part of #274
Overview
The
strimzi-cluster-operator
throwsNullPointerException
in a loop due to missing schema validation in CRD.According to the docs,
checkIssuer
is one of many optional configurations that could be applied when the authentication type isoauth
. WhencheckIssuer
is provided withoutoauth
authentication type (e.g. usingcustom
instead), is it expected for the operator to reject the config through apiserver-side validation. However in reality, the additional (optional) config causes thestrimzi-cluster-operator
to throwNullPointerException
in a loop and the state would never reconcile.Steps to Reproduce
Deploy a Kafka cluster with one of the listerns' authentication to be
custom
type, while setting the checkIssuer to betrue
Deploy with version 0.38.0
kubectl create namespace kafka kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' kubectl apply -f cr.yaml -n kafka
Observe the exception logs from
strimzi-cluster-operator
podPotential Fix
One potential fix could be using the Kubernetes CRD validation rules to reject semantically incorrect configs to avoid runtime errors caused by unexpected input configurations.
We have tried this fix and confirmed this can fix the problem. We are happy to submit a PR to fix this.
For example
The text was updated successfully, but these errors were encountered: