Merge pull request #12924 from porridge/drop-apis

Drop unused field.
pull/13164/head
Joe Julian 6 months ago committed by GitHub
commit cda2c4f802
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -165,7 +165,7 @@ func (cfg *Configuration) renderResources(ch *chart.Chart, values chartutil.Valu
// Sort hooks, manifests, and partials. Only hooks and manifests are returned, // Sort hooks, manifests, and partials. Only hooks and manifests are returned,
// as partials are not used after renderer.Render. Empty manifests are also // as partials are not used after renderer.Render. Empty manifests are also
// removed here. // removed here.
hs, manifests, err := releaseutil.SortManifests(files, caps.APIVersions, releaseutil.InstallOrder) hs, manifests, err := releaseutil.SortManifests(files, nil, releaseutil.InstallOrder)
if err != nil { if err != nil {
// By catching parse errors here, we can prevent bogus releases from going // By catching parse errors here, we can prevent bogus releases from going
// to Kubernetes. // to Kubernetes.

@ -196,13 +196,9 @@ func joinErrors(errs []error) string {
// deleteRelease deletes the release and returns list of delete resources and manifests that were kept in the deletion process // deleteRelease deletes the release and returns list of delete resources and manifests that were kept in the deletion process
func (u *Uninstall) deleteRelease(rel *release.Release) (kube.ResourceList, string, []error) { func (u *Uninstall) deleteRelease(rel *release.Release) (kube.ResourceList, string, []error) {
var errs []error var errs []error
caps, err := u.cfg.getCapabilities()
if err != nil {
return nil, rel.Manifest, []error{errors.Wrap(err, "could not get apiVersions from Kubernetes")}
}
manifests := releaseutil.SplitManifests(rel.Manifest) manifests := releaseutil.SplitManifests(rel.Manifest)
_, files, err := releaseutil.SortManifests(manifests, caps.APIVersions, releaseutil.UninstallOrder) _, files, err := releaseutil.SortManifests(manifests, nil, releaseutil.UninstallOrder)
if err != nil { if err != nil {
// We could instead just delete everything in no particular order. // We could instead just delete everything in no particular order.
// FIXME: One way to delete at this point would be to try a label-based // FIXME: One way to delete at this point would be to try a label-based

@ -53,7 +53,7 @@ var (
type Capabilities struct { type Capabilities struct {
// KubeVersion is the Kubernetes version. // KubeVersion is the Kubernetes version.
KubeVersion KubeVersion KubeVersion KubeVersion
// APIversions are supported Kubernetes API versions. // APIVersions are supported Kubernetes API versions.
APIVersions VersionSet APIVersions VersionSet
// HelmVersion is the build information for this helm version // HelmVersion is the build information for this helm version
HelmVersion helmversion.BuildInfo HelmVersion helmversion.BuildInfo

@ -41,7 +41,6 @@ type Manifest struct {
type manifestFile struct { type manifestFile struct {
entries map[string]string entries map[string]string
path string path string
apis chartutil.VersionSet
} }
// result is an intermediate structure used during sorting. // result is an intermediate structure used during sorting.
@ -75,7 +74,7 @@ var events = map[string]release.HookEvent{
// //
// Files that do not parse into the expected format are simply placed into a map and // Files that do not parse into the expected format are simply placed into a map and
// returned. // returned.
func SortManifests(files map[string]string, apis chartutil.VersionSet, ordering KindSortOrder) ([]*release.Hook, []Manifest, error) { func SortManifests(files map[string]string, _ chartutil.VersionSet, ordering KindSortOrder) ([]*release.Hook, []Manifest, error) {
result := &result{} result := &result{}
var sortedFilePaths []string var sortedFilePaths []string
@ -100,7 +99,6 @@ func SortManifests(files map[string]string, apis chartutil.VersionSet, ordering
manifestFile := &manifestFile{ manifestFile := &manifestFile{
entries: SplitManifests(content), entries: SplitManifests(content),
path: filePath, path: filePath,
apis: apis,
} }
if err := manifestFile.sort(result); err != nil { if err := manifestFile.sort(result); err != nil {

@ -22,7 +22,6 @@ import (
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/release"
) )
@ -139,7 +138,7 @@ metadata:
manifests[o.path] = o.manifest manifests[o.path] = o.manifest
} }
hs, generic, err := SortManifests(manifests, chartutil.VersionSet{"v1", "v1beta1"}, InstallOrder) hs, generic, err := SortManifests(manifests, nil, InstallOrder)
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }

Loading…
Cancel
Save