@ -576,6 +576,20 @@ func (s *SQL) Create(key string, rel release.Releaser) error {
}
}
// Update updates a release.
// Update updates a release.
//
// Custom labels on an existing revision are meant to be preserved. A release's
// labels are set by Create, and a revision keeps the labels it was created with
// once it is superseded, rather than picking up the labels of the upgrade that
// superseded it. TestUpgradeRelease_Labels in pkg/action is what asserts this.
//
// The drivers arrive at that from opposite directions. Here labels live in a
// separate table written only by Create, so an update leaves them untouched. The
// configmaps, memory and secrets drivers instead store labels on the record
// itself and replace the record wholesale on update, so they have to re-apply
// the labels every time or the update would discard all of them. A side effect
// is that those drivers persist a label change where this driver silently would
// not. No caller changes labels between Create and Update, so the two agree in
// practice.
func ( s * SQL ) Update ( key string , rel release . Releaser ) error {
func ( s * SQL ) Update ( key string , rel release . Releaser ) error {
rls , err := releaserToV1Release ( rel )
rls , err := releaserToV1Release ( rel )
if err != nil {
if err != nil {