-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide additional information in version check return. Return map of…
… requirements rather than list
- Loading branch information
Showing
4 changed files
with
141 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,10 +294,39 @@ func TestChartsVersionCheck(t *testing.T) { | |
chartVersions, err := c.VersionCheck("") | ||
assert.NoError(t, err) | ||
|
||
// stable/prometheus is deprecated so only the 11.12.1 should ever be returned | ||
assert.Equal(t, 1, len(chartVersions)) | ||
assert.Equal(t, "stable/prometheus", chartVersions[0].Name) | ||
assert.Equal(t, "11.12.1", chartVersions[0].Version) | ||
// stable/prometheus is deprecated so only the 11.12.1 should ever be returned as latest | ||
latestPrometheusChartVersion := ChartSearchVersion{ | ||
Name: "stable/prometheus", | ||
Version: "11.12.1", | ||
AppVersion: "2.20.1", | ||
Description: "DEPRECATED Prometheus is a monitoring system and time series database.", | ||
} | ||
stableExpected := RequiresVersionInfo{ | ||
Name: "stable/prometheus", | ||
Directory: "", | ||
CurrentVersion: "11.12.0", | ||
UsingLatestVersion: false, | ||
LatestVersion: latestPrometheusChartVersion, | ||
LatestMatchingMajorVersion: latestPrometheusChartVersion, | ||
LatestMatchingMinorVersion: latestPrometheusChartVersion, | ||
} | ||
oldExpected := RequiresVersionInfo{ | ||
Name: "stable/prometheus", | ||
Directory: "old", | ||
CurrentVersion: "11.11.0", | ||
UsingLatestVersion: false, | ||
LatestVersion: latestPrometheusChartVersion, | ||
LatestMatchingMajorVersion: latestPrometheusChartVersion, | ||
LatestMatchingMinorVersion: ChartSearchVersion{ | ||
Name: "stable/prometheus", | ||
Version: "11.11.1", | ||
AppVersion: "2.19.0", | ||
Description: "Prometheus is a monitoring system and time series database.", | ||
}, | ||
} | ||
assert.Equal(t, 2, len(chartVersions)) | ||
assert.Equal(t, stableExpected, chartVersions["stable/[email protected]"]) | ||
assert.Equal(t, oldExpected, chartVersions["stable/[email protected]"]) | ||
} | ||
|
||
func TestVersionCheckWithConfig(t *testing.T) { | ||
|
@@ -329,8 +358,22 @@ repositories: | |
chartVersions, err := c.VersionCheck(filepath.Join(tempDir, "helmConfig.yaml")) | ||
assert.NoError(t, err) | ||
|
||
// stable/prometheus is deprecated so only the 11.12.1 should ever be returned | ||
// stable/prometheus is deprecated so only the 11.12.1 should ever be returned as latest | ||
latestPrometheusChartVersion := ChartSearchVersion{ | ||
Name: "private/prometheus", | ||
Version: "11.12.1", | ||
AppVersion: "2.20.1", | ||
Description: "DEPRECATED Prometheus is a monitoring system and time series database.", | ||
} | ||
expected := RequiresVersionInfo{ | ||
Name: "private/prometheus", | ||
Directory: "", | ||
CurrentVersion: "11.12.0", | ||
UsingLatestVersion: false, | ||
LatestVersion: latestPrometheusChartVersion, | ||
LatestMatchingMajorVersion: latestPrometheusChartVersion, | ||
LatestMatchingMinorVersion: latestPrometheusChartVersion, | ||
} | ||
assert.Equal(t, 1, len(chartVersions)) | ||
assert.Equal(t, "private/prometheus", chartVersions[0].Name) | ||
assert.Equal(t, "11.12.1", chartVersions[0].Version) | ||
assert.Equal(t, expected, chartVersions["private/[email protected]"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters