-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix Topic Operator's reconciliationIntervalMs type #10158
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.
Why should it be long?
I started from the model, where we have the Exception in thread "main" io.strimzi.operator.common.InvalidConfigurationException: Failed to parse. Negative value is not supported for this configuration If you prefer, we can use int for the spec, but then I would do the same for the User Operator, and possibly improve the configuration error message in a different PR. |
5db06a3
to
d8644f9
Compare
I am fine to align them because the meaning of the variable is the same. So |
To be honest, I do not think this is a good enough reason to change it from int to long. |
When you use the env var Don't you think that consistency is important here? Why the TO and UO should behave differently? See also my proposal in the next comment.
Yeah, that's not an option now. We may get this change and log an improvement for v1, where we can break compatibility. In that case, we could move both to int, or keep long to align with the env var, maybe renaming to |
Is it confusing to use milliseconds in one place (although slightly hidden from the user) and seconds in another one? Likely yes, but we cannot change the API easily. Feel free to open an issue and we can try to improve it in the But changing an int to long as you do here does not fix this problem. And it is probably better if you get an error here than if it happily accepts your millisecond value as seconds value.
It is important to use consistently the correct things. Not be consistent in doing the wrong thing. Also, as a sidenote ... there is not much consistency between the TO and the other operators. In the PR next to this one, you seem to be happy to continue and extend the inconsistencies there (for exaample by using the |
Fair enough. I'll remove the TO spec change from this PR and log an issue.
Never said that. I was talking about behavior consistency, which is a different thing. If you think there is some issue with using var, please comment on the specific context and I'll be happy to discuss and make improvements. |
I do not see any inconsistent behavior here in this case. There is inconsistent use of int and long, but no inconsistent behavior. As for |
If you insert a value that overflows int, then you have a different behavior. The UO will take it, while the TO will fail (which is better, as you say). |
@scholzj spec changes are reverted now. |
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.
The code LGTM. Please update the PR description.
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
The reconciliationIntervalMs should be of type long, as it is dealing with milliseconds, and it is also defined as long in the User Operator model class. Signed-off-by: Federico Valeri <[email protected]>
Signed-off-by: Federico Valeri <[email protected]>
c149f39
to
36efdf4
Compare
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
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
The
reconciliationIntervalMs
should be of type long, as it is dealing with milliseconds, and it is also defined as long in the User Operator model class.