-
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
clusterctl generate provider
should return early if working with incompatible provider versions
#5864
Comments
/milestone v1.1 |
+1, Afaik we already have a similar logic for |
@ykakarap I like to work on this |
@tharun208 Great! Feel free to assign yourself the issue with |
sure, thanks and can you help me with this issue, as this is going to be my first PR for cluster-api. |
/assign |
@tharun208 Thanks for offering to work on the issue. Later, I will add some details here that should help you get started. |
@tharun208 Here are some details that should help you get started: The I think you can start with adding a Checking compatibility: // Get the providers metadata.
configRepository, err := c.configClient.Providers().Get(providerName, provider.GetProviderType())
if err != nil {
return "", err
}
providerRepository, err := c.repositoryClientFactory(configRepository, c.configClient)
if err != nil {
return "", err
}
latestMetadata, err := providerRepository.Metadata(providerVersion).Get()
if err != nil {
return "", err
}
// Gets the contract for the current release.
currentVersion, err := version.ParseSemantic(providerVersion)
if err != nil {
return "", errors.Wrapf(err, "failed to parse current version for the %s provider", providerName)
}
releaseSeries := latestMetadata.GetReleaseSeriesForVersion(currentVersion)
if releaseSeries.Contract != clusterv1.GroupVersion.Version {
return "", errors.Errorf("current version of clusterctl is only compatible with %s providers, detected %s for provider %s", clusterv1.GroupVersion.Version, releaseSeries.Contract, provider.ManifestLabel())
} Note: Please adjust the returns in the above example as needed for the function. You can use If the contracts match then we can consider that the version of the provider is compatible with the version of clusterctl. Once validated then you can go ahead and call I hope this information is helpful for you to get started on this issue. Please feel free to reach out if you have any questions. 🙂 |
thank you much. will look into this |
Fixes kubernetes-sigs#5864 Signed-off-by: tharun <[email protected]>
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
/triage accepted |
User Story
As a user when I run
clusterctl generate provider
on a version of a provider that is incompatible I want it to return early with an error messages that says that the version is incompatible with the version of clusterctl.Detailed Description
Ref: #5851 (comment) for more details.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
/kind feature
/area clusterctl
The text was updated successfully, but these errors were encountered: