Add comments about the Kubernetes storage object type field content

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
pull/6500/head
Martin Hickey 6 years ago
parent c3b565e339
commit 8b0d3a34f9

@ -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("status", rls.Info.Status.String())
lbs.set("version", strconv.Itoa(rls.Version)) 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:
// <helm_domain>/<helm_object>.v<helm_object_version>
// 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{ return &v1.Secret{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: key, Name: key,

@ -27,6 +27,11 @@ import (
"helm.sh/helm/pkg/storage/driver" "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" const HelmStorageType = "sh.helm.release.v1"
// Storage represents a storage engine for a Release. // 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 return h[0], nil
} }
// makeKey concatenates the helm type, a release name and version into a // makeKey concatenates the Kubernetes storage object type, a release name and version
// string with format:```<helm_storage_type>.<release_name>.v<version>```. // into a string with format:```<helm_storage_type>.<release_name>.v<release_version>```.
// The Helm type is prepended to keep name uniqueness between different // The storage type is prepended to keep name uniqueness between different
// release storage types. An example of clash when not using the type: // release storage types. An example of clash when not using the type:
// https://github.com/helm/helm/issues/6435. // https://github.com/helm/helm/issues/6435.
// This key is used to uniquely identify storage objects. // This key is used to uniquely identify storage objects.

Loading…
Cancel
Save