Skip to content

Commit

Permalink
FWI-5853 - Add kubeVersion field nova results (#299)
Browse files Browse the repository at this point in the history
* Add kubeVersion field nova results

* Update logging level for duplicate release output

* fix to always dedupe output

* Add marshalWithoutHTMLEscaping function for JSON encoding without HTML escaping

* Fix comment capitalization in Dedupe function
  • Loading branch information
vitorvezani authored Mar 21, 2024
1 parent 38212b4 commit 1709b1e
Show file tree
Hide file tree
Showing 13 changed files with 509,452 additions and 937,439 deletions.
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ func handleHelm(kubeContext string) (*output.Output, error) {
outputObjects := h.GetHelmReleasesVersion(helmRepos, releases)
out.HelmReleases = append(out.HelmReleases, outputObjects...)
}
out.Dedupe()
return &out, nil
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/containers/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,6 @@ func (i *Image) populateNewest() error {
// There may be unintended consequenses from this. We do our best by ignoring actual common pre-release tags in the variable preReleaseIgnore.
// This means if you are currently running 1.2.3-beta.0 the filter will not limit the upgrade suggestions to other beta releases.
filter := i.Current.version.Prerelease()
if err != nil {
return err
}
for _, tag := range i.semverTags {
if tag.Prerelease() != filter && preReleaseRegex(preReleaseIgnore, tag.Prerelease()) {
continue
Expand Down
1 change: 1 addition & 0 deletions pkg/helm/artifacthub.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type ArtifactHubHelmPackage struct {
DisplayName string `json:"display_name"`
Description string `json:"description"`
AppVersion string `json:"app_version"`
KubeVersion string `json:"kube_version"`
Official bool `json:"official"`
Deprecated bool `json:"deprecated"`
Repository ArtifactHubRepository `json:"repository"`
Expand Down
12 changes: 6 additions & 6 deletions pkg/helm/artifacthub_cached.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ type ArtifactHubCachedRepository struct {

// ArtifactHubCachedVersionInfo represents the chart and application version of a package
type ArtifactHubCachedVersionInfo struct {
Version string `json:"pkg"`
AppVersion string `json:"app"`
Deprecated bool `json:"deprecated"`
Version string `json:"pkg"`
AppVersion string `json:"app"`
KubeVersion string `json:"kube"`
Deprecated bool `json:"deprecated"`
}

// NewArtifactHubCachedPackageClient returns a new client for the unauthenticated paths of the ArtifactHubCached API.
Expand Down Expand Up @@ -137,11 +138,10 @@ func (ac *ArtifactHubCachedPackageClient) List() ([]ArtifactHubHelmPackage, erro
for _, version := range cachedPackage.Versions {
if version.Version == cachedPackage.LatestVersion {
packages[idx].AppVersion = version.AppVersion
packages[idx].KubeVersion = version.KubeVersion
packages[idx].Deprecated = version.Deprecated
}
packages[idx].AvailableVersions = append(packages[idx].AvailableVersions, AvailableVersion{
Version: version.Version,
})
packages[idx].AvailableVersions = append(packages[idx].AvailableVersions, AvailableVersion{Version: version.Version})
}
}
return packages, nil
Expand Down
Loading

0 comments on commit 1709b1e

Please sign in to comment.