mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[v9.5.x] Prometheus: Version detect bug (#71243)
Prometheus: Version detect bug (#71198)
* remove redundant request copy in backend, add more versions to semver lists
(cherry picked from commit 7dc071f46b
)
Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
This commit is contained in:
parent
2755a139e9
commit
02fe2856da
@ -81,16 +81,5 @@ func (r *Resource) DetectVersion(ctx context.Context, req *backend.CallResourceR
|
|||||||
Path: "/api/v1/status/buildinfo",
|
Path: "/api/v1/status/buildinfo",
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := r.Execute(ctx, newReq)
|
return r.Execute(ctx, newReq)
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
callResponse := &backend.CallResourceResponse{
|
|
||||||
Status: 200,
|
|
||||||
Body: resp.Body,
|
|
||||||
}
|
|
||||||
|
|
||||||
return callResponse, nil
|
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,19 @@ export const PromFlavorVersions: { [index: string]: Array<{ value?: string; labe
|
|||||||
{ value: '2.38.0', label: '2.38.x' },
|
{ value: '2.38.0', label: '2.38.x' },
|
||||||
{ value: '2.39.0', label: '2.39.x' },
|
{ value: '2.39.0', label: '2.39.x' },
|
||||||
{ value: '2.40.0', label: '2.40.x' },
|
{ value: '2.40.0', label: '2.40.x' },
|
||||||
|
{ value: '2.41.0', label: '2.41.x' },
|
||||||
|
{ value: '2.42.0', label: '2.42.x' },
|
||||||
|
{ value: '2.43.0', label: '2.43.x' },
|
||||||
|
{ value: '2.44.0', label: '2.44.x' },
|
||||||
|
{ value: '2.45.0', label: '2.45.x' },
|
||||||
|
{ value: '2.46.0', label: '2.46.x' },
|
||||||
|
{ value: '2.47.0', label: '2.47.x' },
|
||||||
|
{ value: '2.48.0', label: '2.48.x' },
|
||||||
|
{ value: '2.49.0', label: '2.49.x' },
|
||||||
|
{ value: '2.50.0', label: '2.50.x' },
|
||||||
|
|
||||||
// This value will be returned for future versions of prometheus until we add new entries to this object
|
// This value will be returned for future versions of prometheus until we add new entries to this object
|
||||||
{ value: '2.40.1', label: '> 2.40.x' },
|
{ value: '2.50.1', label: '> 2.50.x' },
|
||||||
],
|
],
|
||||||
Mimir: [
|
Mimir: [
|
||||||
{ value: undefined, label: 'Please select' },
|
{ value: undefined, label: 'Please select' },
|
||||||
@ -39,7 +49,13 @@ export const PromFlavorVersions: { [index: string]: Array<{ value?: string; labe
|
|||||||
{ value: '2.1.0', label: '2.1.x' },
|
{ value: '2.1.0', label: '2.1.x' },
|
||||||
{ value: '2.2.0', label: '2.2.x' },
|
{ value: '2.2.0', label: '2.2.x' },
|
||||||
{ value: '2.3.0', label: '2.3.x' },
|
{ value: '2.3.0', label: '2.3.x' },
|
||||||
{ value: '2.4.0', label: '> 2.3.x' },
|
{ value: '2.4.0', label: '2.4.x' },
|
||||||
|
{ value: '2.5.0', label: '2.5.x' },
|
||||||
|
{ value: '2.6.0', label: '2.6.x' },
|
||||||
|
{ value: '2.7.0', label: '2.7.x' },
|
||||||
|
{ value: '2.8.0', label: '2.8.x' },
|
||||||
|
{ value: '2.9.0', label: '2.9.x' },
|
||||||
|
{ value: '2.9.1', label: '> 2.9.x' },
|
||||||
],
|
],
|
||||||
Thanos: [
|
Thanos: [
|
||||||
{ value: undefined, label: 'Please select' },
|
{ value: undefined, label: 'Please select' },
|
||||||
@ -57,7 +73,10 @@ export const PromFlavorVersions: { [index: string]: Array<{ value?: string; labe
|
|||||||
{ value: '0.26.0', label: '0.26.x' },
|
{ value: '0.26.0', label: '0.26.x' },
|
||||||
{ value: '0.27.0', label: '0.27.x' },
|
{ value: '0.27.0', label: '0.27.x' },
|
||||||
{ value: '0.28.0', label: '0.28.x' },
|
{ value: '0.28.0', label: '0.28.x' },
|
||||||
{ value: '0.29.0', label: '> 0.28.x' },
|
{ value: '0.29.0', label: '0.29.x' },
|
||||||
|
{ value: '0.30.0', label: '0.30.x' },
|
||||||
|
{ value: '0.31.0', label: '0.31.x' },
|
||||||
|
{ value: '0.31.1', label: '> 0.31.x' },
|
||||||
],
|
],
|
||||||
Cortex: [
|
Cortex: [
|
||||||
{ value: undefined, label: 'Please select' },
|
{ value: undefined, label: 'Please select' },
|
||||||
|
@ -63,8 +63,7 @@ type Props = Pick<DataSourcePluginOptionsEditorProps<PromOptions>, 'options' | '
|
|||||||
* Bugs: It will only reject versions that are a major release apart, so Mimir 2.x might get selected for Prometheus 2.8 if the user selects an incorrect flavor
|
* Bugs: It will only reject versions that are a major release apart, so Mimir 2.x might get selected for Prometheus 2.8 if the user selects an incorrect flavor
|
||||||
* Advantages: We don't need to maintain a list of every possible version for each release
|
* Advantages: We don't need to maintain a list of every possible version for each release
|
||||||
*
|
*
|
||||||
* This function will return the closest version from PromFlavorVersions that is equal or lower to the version argument,
|
* This function will return the closest version from PromFlavorVersions that is equal or lower to the version argument
|
||||||
* unless the versions are a major release apart.
|
|
||||||
*/
|
*/
|
||||||
const getVersionString = (version: string, flavor?: string): string | undefined => {
|
const getVersionString = (version: string, flavor?: string): string | undefined => {
|
||||||
if (!flavor || !PromFlavorVersions[flavor]) {
|
if (!flavor || !PromFlavorVersions[flavor]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user