From 7938662f959011d9fa6763f6124834ea446ae424 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Wed, 19 Mar 2025 13:54:00 -0400 Subject: [PATCH 1/2] Remove ValidName regex This regex was already deprecated. Validation happens inside the Metadata Validate function for the name instead of using this regex. Signed-off-by: Matt Farina --- pkg/action/action.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pkg/action/action.go b/pkg/action/action.go index ea2dc0dd7..187df5412 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -23,7 +23,6 @@ import ( "os" "path" "path/filepath" - "regexp" "strings" "github.com/pkg/errors" @@ -63,21 +62,6 @@ var ( errPending = errors.New("another operation (install/upgrade/rollback) is in progress") ) -// ValidName is a regular expression for resource names. -// -// DEPRECATED: This will be removed in Helm 4, and is no longer used here. See -// pkg/lint/rules.validateMetadataNameFunc for the replacement. -// -// According to the Kubernetes help text, the regular expression it uses is: -// -// [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* -// -// This follows the above regular expression (but requires a full string match, not partial). -// -// The Kubernetes documentation is here, though it is not entirely correct: -// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -var ValidName = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`) - // Configuration injects the dependencies that all actions share. type Configuration struct { // RESTClientGetter is an interface that loads Kubernetes clients. From ed005f5c320c2059da3528f967e556d5123496b3 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Thu, 10 Apr 2025 13:45:02 -0400 Subject: [PATCH 2/2] Removing deprecation notice for this function. While the constructor is not used by Helm itself, it is used by SDK users and there is currently no alternative way to expose this. Signed-off-by: Matt Farina --- pkg/engine/lookup_func.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/engine/lookup_func.go b/pkg/engine/lookup_func.go index b7460850a..5b96dd386 100644 --- a/pkg/engine/lookup_func.go +++ b/pkg/engine/lookup_func.go @@ -35,9 +35,6 @@ type lookupFunc = func(apiversion string, resource string, namespace string, nam // NewLookupFunction returns a function for looking up objects in the cluster. // // If the resource does not exist, no error is raised. -// -// This function is considered deprecated, and will be renamed in Helm 4. It will no -// longer be a public function. func NewLookupFunction(config *rest.Config) lookupFunc { return newLookupFunction(clientProviderFromConfig{config: config}) }