diff --git a/pkg/storage/driver/secrets.go b/pkg/storage/driver/secrets.go index 88e307cb3..edd1cca0d 100644 --- a/pkg/storage/driver/secrets.go +++ b/pkg/storage/driver/secrets.go @@ -228,7 +228,17 @@ func newSecretsObject(key string, rls *rspb.Release, lbs labels) (*v1.Secret, er lbs.set("status", rls.Info.Status.String()) lbs.set("version", strconv.Itoa(rls.Version)) - // create and return secret object + // create and return secret object. + // Helm 3 introduced setting the 'Type' field + // in the Kubernetes storage object. + // Helm defines the field content as follows: + // /.v + // Type field for Helm 3: helm.sh/release.v1 + // Note: Version starts at 'v1' for Helm 3 and + // should be incremented if the release object + // metadata is modified. + // This would potentially be a breaking change + // and should only happen between major versions. return &v1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: key, diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index 753b462e5..e676ac474 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -27,6 +27,11 @@ import ( "helm.sh/helm/pkg/storage/driver" ) +// The type field of the Kubernetes storage object which stores the Helm release +// version. It is modified slightly replacing the '/': sh.helm/release.v1 +// Note: The version 'v1' is incremented if the release object metadata is +// modified between major releases. +// This constant is used as a prefix for the Kubernetes storage object name. const HelmStorageType = "sh.helm.release.v1" // Storage represents a storage engine for a Release. @@ -207,9 +212,9 @@ func (s *Storage) Last(name string) (*rspb.Release, error) { return h[0], nil } -// makeKey concatenates the helm type, a release name and version into a -// string with format:```..v```. -// The Helm type is prepended to keep name uniqueness between different +// makeKey concatenates the Kubernetes storage object type, a release name and version +// into a string with format:```..v```. +// The storage type is prepended to keep name uniqueness between different // release storage types. An example of clash when not using the type: // https://github.com/helm/helm/issues/6435. // This key is used to uniquely identify storage objects.