From 00c6b47d99b60aca4f5739f8b6400e8a5462ca23 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Sat, 3 Jan 2026 18:45:45 +0100 Subject: [PATCH] Maintain old error names for backwards compatibility Signed-off-by: Mads Jensen --- pkg/chart/common/errors.go | 15 +++++++++++++++ pkg/chart/v2/lint/support/message.go | 3 +++ pkg/downloader/manager.go | 2 ++ pkg/downloader/manager_test.go | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkg/chart/common/errors.go b/pkg/chart/common/errors.go index b6c99e7a5..4525588ce 100644 --- a/pkg/chart/common/errors.go +++ b/pkg/chart/common/errors.go @@ -20,6 +20,11 @@ import ( "fmt" ) +// ErrNoTable exists due to compatibilty with API users +// +//nolint:errname +type ErrNoTable = NoTableError + // NoTableError indicates that a chart does not have a matching table. type NoTableError struct { Key string @@ -27,6 +32,11 @@ type NoTableError struct { func (e NoTableError) Error() string { return fmt.Sprintf("%q is not a table", e.Key) } +// ErrNoValue exists due to compatibilty with API users +// +//nolint:errname +type ErrNoValue = NoValueError + // NoValueError indicates that Values does not contain a key with a value type NoValueError struct { Key string @@ -34,6 +44,11 @@ type NoValueError struct { func (e NoValueError) Error() string { return fmt.Sprintf("%q is not a value", e.Key) } +// ErrInvalidChartName exists due to compatibilty with API users +// +//nolint:errname +type ErrInvalidChartName = InvalidChartNameError + type InvalidChartNameError struct { Name string } diff --git a/pkg/chart/v2/lint/support/message.go b/pkg/chart/v2/lint/support/message.go index f01d7fc76..7382b03ac 100644 --- a/pkg/chart/v2/lint/support/message.go +++ b/pkg/chart/v2/lint/support/message.go @@ -41,6 +41,9 @@ type Linter struct { ChartDir string } +//nolint:errname +type Message = LintMessageError + // Message describes an error encountered while linting. type LintMessageError struct { // Severity is one of the *Sev constants diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index f95071855..40caa1579 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -45,6 +45,8 @@ import ( "helm.sh/helm/v4/pkg/repo/v1" ) +type ErrRepoNotFound = RepoNotFoundError + // RepoNotFoundError indicates that chart repositories can't be found in local repo cache. // The value of Repos is missing repos. type RepoNotFoundError struct { diff --git a/pkg/downloader/manager_test.go b/pkg/downloader/manager_test.go index 85619e196..0e246a284 100644 --- a/pkg/downloader/manager_test.go +++ b/pkg/downloader/manager_test.go @@ -550,7 +550,7 @@ func TestBuild_WithRepositoryAlias(t *testing.T) { }) } -func TestErrRepoNotFound_Error(t *testing.T) { +func TestRepoNotFound_Error(t *testing.T) { type fields struct { Repos []string }