|
|
@ -19,6 +19,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"sort"
|
|
|
|
"sort"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
@ -368,6 +369,9 @@ func (s *SQL) List(filter func(*rspb.Release) bool) ([]*rspb.Release, error) {
|
|
|
|
s.Log("failed to get release %s/%s custom labels: %v", record.Namespace, record.Key, err)
|
|
|
|
s.Log("failed to get release %s/%s custom labels: %v", record.Namespace, record.Key, err)
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range getReleaseSystemLabels(release) {
|
|
|
|
|
|
|
|
release.Labels[k] = v
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if filter(release) {
|
|
|
|
if filter(release) {
|
|
|
|
releases = append(releases, release)
|
|
|
|
releases = append(releases, release)
|
|
|
@ -681,3 +685,13 @@ func (s *SQL) getReleaseCustomLabels(key string, namespace string) (map[string]s
|
|
|
|
|
|
|
|
|
|
|
|
return filterSystemLabels(labelsMap), nil
|
|
|
|
return filterSystemLabels(labelsMap), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rebuild system labels from release object
|
|
|
|
|
|
|
|
func getReleaseSystemLabels(rls *rspb.Release) map[string]string {
|
|
|
|
|
|
|
|
return map[string]string{
|
|
|
|
|
|
|
|
"name": rls.Name,
|
|
|
|
|
|
|
|
"owner": sqlReleaseDefaultOwner,
|
|
|
|
|
|
|
|
"status": rls.Info.Status.String(),
|
|
|
|
|
|
|
|
"version": strconv.Itoa(rls.Version),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|