|
|
@ -24,6 +24,7 @@ import (
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"log"
|
|
|
|
"log"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
|
@ -31,6 +32,7 @@ import (
|
|
|
|
kberrs "k8s.io/kubernetes/pkg/api/errors"
|
|
|
|
kberrs "k8s.io/kubernetes/pkg/api/errors"
|
|
|
|
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion"
|
|
|
|
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion"
|
|
|
|
kblabels "k8s.io/kubernetes/pkg/labels"
|
|
|
|
kblabels "k8s.io/kubernetes/pkg/labels"
|
|
|
|
|
|
|
|
"k8s.io/kubernetes/pkg/util/validation"
|
|
|
|
|
|
|
|
|
|
|
|
rspb "k8s.io/helm/pkg/proto/hapi/release"
|
|
|
|
rspb "k8s.io/helm/pkg/proto/hapi/release"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -119,6 +121,9 @@ func (cfgmaps *ConfigMaps) List(filter func(*rspb.Release) bool) ([]*rspb.Releas
|
|
|
|
func (cfgmaps *ConfigMaps) Query(labels map[string]string) ([]*rspb.Release, error) {
|
|
|
|
func (cfgmaps *ConfigMaps) Query(labels map[string]string) ([]*rspb.Release, error) {
|
|
|
|
ls := kblabels.Set{}
|
|
|
|
ls := kblabels.Set{}
|
|
|
|
for k, v := range labels {
|
|
|
|
for k, v := range labels {
|
|
|
|
|
|
|
|
if errs := validation.IsValidLabelValue(v); len(errs) != 0 {
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("invalid label value: %q: %s", v, strings.Join(errs, "; "))
|
|
|
|
|
|
|
|
}
|
|
|
|
ls[k] = v
|
|
|
|
ls[k] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|