-
Notifications
You must be signed in to change notification settings - Fork 350
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
Feat(cli): version operator and warning compatibility message #1912
Feat(cli): version operator and warning compatibility message #1912
Conversation
Few points I'd like to hear about:
|
That is a great improvement! Here are my first feedback:
|
Another point is the retrieval of the operator version. Relying on extracting the tag from the Deployment image may fail in a number of situations, like when SHA pinning is used. I would suggest to exec into the operator container and run the |
It was my first choice, but later I realized that the client version is meant to work also "offline". I can rework that part in order to skip the online/offline check and have either the operator version or a message error when disconnected, wdyt?
This would be nice, though it requires quite a few changes, and during development we must find a way to "mark" when some change is breaking compatibility. I think for the time being an informative message is a good addition to inform the user that if something does not work, it may be because the cli/operator misalignment. |
I agree, if that is easy enough, it can print a message that no operator version can be retrieve. It may also happen when no operator is deployment in the current context, or there is no default context.
I agree. An informative message is an acceptable tradeoff. |
I just had a quick look at It also has an $ kubectl version -h
Print the client and server version information for the current context
Examples:
# Print the client and server versions for the current context
kubectl version
Options:
--client=false: Client version only (no server required).
-o, --output='': One of 'yaml' or 'json'.
--short=false: Print just the version number. |
Another point about retrieving the operator version is that it may be there are multiple replicas of the operator for HA. Ideally, the |
Note that |
I am making the development to |
It has indeed security concerns, and UX as a result. For that approach to work, the end-user has to have the permission to run the Other options that I can think of would be:
While the WDYT? |
I was exactly looking at the possibility to expose a
I see this more appropriate and we can include any further info that we will retain useful in the future (plus gitCommit and such). Can you point me at the code where we expose health and monitoring please? I can work to include this new endpoint. The only drawback is that there is no way to make this change backward compatible and will work only with CLI/operators installed from newer versions. |
Great, let's dive into the The health and monitoring endpoints are delegated to controller-runtime: camel-k/pkg/cmd/operator/operator.go Lines 130 to 131 in aaeb457
I'm not sure it's possible to hook into these. Otherwise we can start our own listener. For the backward compatibility point, better sooner than later 😉. |
I had a thought at the possibility to include a version endpoint. If we go in that direction we must expose the version endpoint publicly in order to be externally read: health and monitoring are not public endpoint. We also may have difficulty to know beforehand where a In the while I think we have a better way to deal with the problem and solve the |
Right, resolving the version from the |
Haha, no, not at all. I'd been sticking with the original draft instead looking for alternatives. Also a good exercise for me to dig and learn more about the software ;) |
As mentioned in apache#1912, moving the logic to recover the operator version from each namespace IntegrationPlatform. This would solve the problem when any global operator is installed. Ref apache#1652
Ready for review now. @astefanutti if you want to have a look :) |
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.
Looks great! Eager to try it! Thanks a lot.
* Added a --operator flag to get the operator version taken from cluster Deployment config * PreRun default checks has to change to allow decoding options before setting the command as offline mode Ref apache#1652
* Compare client and operator version and send a warning message if major/minor differ * Added a command annotation to apply comparison only to certain commands Closes apache#1652
As mentioned in apache#1912, moving the logic to recover the operator version from each namespace IntegrationPlatform. This would solve the problem when any global operator is installed. Ref apache#1652
3223be5
to
fc1083f
Compare
I've relaunched CI to pass flaky cron e2e tests. |
kamel version --operator
that connect to the cluster (current or user provided namespace) and return the operator version.Closes #1652
Release Note