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

fix: better error when watch api versions are not compatible #4149

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

fraidev
Copy link
Contributor

@fraidev fraidev commented Aug 22, 2024

Related: #3441

@fraidev fraidev requested a review from digikata August 22, 2024 22:12
@fraidev fraidev changed the title chore: return a better user error when watch api versions are not com… fix: return a better user error when watch api versions are not com… Aug 22, 2024
@fraidev fraidev changed the title fix: return a better user error when watch api versions are not com… fix: better error when watch api versions are not compatible Aug 22, 2024
@@ -46,6 +46,7 @@ use tracing::instrument;

/// The minimum VERSION of the Fluvio Platform that this client is compatible with.
const MINIMUM_PLATFORM_VERSION: &str = "0.9.0";
pub(crate) const VERSION: &str = include_str!("../../../VERSION");
Copy link
Contributor

@digikata digikata Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we have this somewhere already? Seems like we should name this PLATFORM_VERSION at least.

Is MINIMUM_PLATFORM_VERSION doing anything useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we have this same const in many places:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, rename only in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About MINIMUM_PLATFORM_VERSION it's been checked after the lookup_version of the watch API. And will return it:

    #[error("Cluster (with platform version {cluster_version}) is older than the minimum required version {client_minimum_version}
To interact with this cluster, please install the matching CLI version using the following command:
    curl -fsS https://hub.infinyon.cloud/install/install.sh | VERSION={cluster_version} bash
    ")]

But as we're not updating this const does not seem so useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove it?

Copy link
Contributor

@digikata digikata Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, let's just leave it all alone until we get a improved wider compatability check.

Lets leave the constant as VERSION. Forget renaming it PLATFORM_VERSION as it would be out of place with all the other crates.

@digikata digikata self-requested a review August 22, 2024 23:48
Copy link
Contributor

@digikata digikata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fraidev fraidev added this pull request to the merge queue Aug 23, 2024
Merged via the queue into infinyon:master with commit 1a56307 Aug 23, 2024
105 checks passed
@fraidev fraidev deleted the watchapi_error branch August 23, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants