Skip to content

Commit

Permalink
Merge pull request prometheus#2707 from prometheus/merge16
Browse files Browse the repository at this point in the history
Merge 1.6 into master
  • Loading branch information
fabxc authored May 11, 2017
2 parents a333c56 + 11aa049 commit 0c34627
Show file tree
Hide file tree
Showing 1,104 changed files with 331,365 additions and 314,278 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.6.2 / 2017-05-11

* [BUGFIX] Fix potential memory leak in Kubernetes service discovery

## 1.6.1 / 2017-04-19

* [BUGFIX] Don't panic if storage has no FPs even after initial wait
Expand Down Expand Up @@ -67,6 +71,10 @@
* [BUGFIX] Fix deadlock in Zookeeper SD.
* [BUGFIX] Fix fuzzy search problems in the web-UI auto-completion.

## 1.5.3 / 2017-05-11

* [BUGFIX] Fix potential memory leak in Kubernetes service discovery

## 1.5.2 / 2017-02-10

* [BUGFIX] Fix series corruption in a special case of series maintenance where
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1
1.6.2
4 changes: 2 additions & 2 deletions discovery/kubernetes/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"golang.org/x/net/context"
apiv1 "k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
apiv1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

// Endpoints discovers new endpoint targets.
Expand Down
13 changes: 7 additions & 6 deletions discovery/kubernetes/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

func endpointsStoreKeyFunc(obj interface{}) (string, error) {
Expand All @@ -40,7 +41,7 @@ func makeTestEndpointsDiscovery() (*Endpoints, *fakeInformer, *fakeInformer, *fa

func makeEndpoints() *v1.Endpoints {
return &v1.Endpoints{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testendpoints",
Namespace: "default",
},
Expand Down Expand Up @@ -123,7 +124,7 @@ func TestEndpointsDiscoveryInitial(t *testing.T) {
func TestEndpointsDiscoveryAdd(t *testing.T) {
n, _, eps, pods := makeTestEndpointsDiscovery()
pods.GetStore().Add(&v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testpod",
Namespace: "default",
},
Expand Down Expand Up @@ -164,7 +165,7 @@ func TestEndpointsDiscoveryAdd(t *testing.T) {
go func() {
eps.Add(
&v1.Endpoints{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testendpoints",
Namespace: "default",
},
Expand Down Expand Up @@ -273,7 +274,7 @@ func TestEndpointsDiscoveryUpdate(t *testing.T) {
afterStart: func() {
go func() {
eps.Update(&v1.Endpoints{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testendpoints",
Namespace: "default",
},
Expand Down
16 changes: 8 additions & 8 deletions discovery/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"golang.org/x/net/context"
"k8s.io/client-go/1.5/kubernetes"
"k8s.io/client-go/1.5/pkg/api"
apiv1 "k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/pkg/util/runtime"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/1.5/tools/cache"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api"
apiv1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
)

const (
Expand Down Expand Up @@ -121,8 +121,8 @@ func New(l log.Logger, conf *config.KubernetesSDConfig) (*Discovery, error) {
CAFile: conf.TLSConfig.CAFile,
CertFile: conf.TLSConfig.CertFile,
KeyFile: conf.TLSConfig.KeyFile,
Insecure: conf.TLSConfig.InsecureSkipVerify,
},
Insecure: conf.TLSConfig.InsecureSkipVerify,
}
token := conf.BearerToken
if conf.BearerTokenFile != "" {
Expand Down Expand Up @@ -158,7 +158,7 @@ const resyncPeriod = 10 * time.Minute

// Run implements the TargetProvider interface.
func (d *Discovery) Run(ctx context.Context, ch chan<- []*config.TargetGroup) {
rclient := d.client.Core().GetRESTClient()
rclient := d.client.Core().RESTClient()

namespaces := d.getNamespaces()

Expand Down
6 changes: 3 additions & 3 deletions discovery/kubernetes/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/util/strutil"
"golang.org/x/net/context"
"k8s.io/client-go/1.5/pkg/api"
apiv1 "k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
"k8s.io/client-go/pkg/api"
apiv1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

// Node discovers Kubernetes nodes.
Expand Down
18 changes: 11 additions & 7 deletions discovery/kubernetes/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"github.com/prometheus/prometheus/config"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

type fakeInformer struct {
Expand All @@ -46,18 +47,21 @@ func newFakeInformer(f func(obj interface{}) (string, error)) *fakeInformer {
return i
}

func (i *fakeInformer) AddEventHandler(handler cache.ResourceEventHandler) error {
i.handlers = append(i.handlers, handler)
func (i *fakeInformer) AddEventHandler(h cache.ResourceEventHandler) {
i.handlers = append(i.handlers, h)
// Only now that there is a registered handler, we are able to handle deltas.
i.blockDeltas.Unlock()
return nil
}

func (i *fakeInformer) AddEventHandlerWithResyncPeriod(h cache.ResourceEventHandler, _ time.Duration) {
i.AddEventHandler(h)
}

func (i *fakeInformer) GetStore() cache.Store {
return i.store
}

func (i *fakeInformer) GetController() cache.ControllerInterface {
func (i *fakeInformer) GetController() cache.Controller {
return nil
}

Expand Down Expand Up @@ -160,7 +164,7 @@ func makeTestNodeDiscovery() (*Node, *fakeInformer) {

func makeNode(name, address string, labels map[string]string, annotations map[string]string) *v1.Node {
return &v1.Node{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: labels,
Annotations: annotations,
Expand Down
6 changes: 3 additions & 3 deletions discovery/kubernetes/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/util/strutil"
"golang.org/x/net/context"
"k8s.io/client-go/1.5/pkg/api"
apiv1 "k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
"k8s.io/client-go/pkg/api"
apiv1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

// Pod discovers new pod targets.
Expand Down
11 changes: 6 additions & 5 deletions discovery/kubernetes/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

func podStoreKeyFunc(obj interface{}) (string, error) {
Expand All @@ -38,7 +39,7 @@ func makeTestPodDiscovery() (*Pod, *fakeInformer) {

func makeMultiPortPod() *v1.Pod {
return &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testpod",
Namespace: "default",
Labels: map[string]string{"testlabel": "testvalue"},
Expand Down Expand Up @@ -82,7 +83,7 @@ func makeMultiPortPod() *v1.Pod {

func makePod() *v1.Pod {
return &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testpod",
Namespace: "default",
},
Expand Down Expand Up @@ -266,7 +267,7 @@ func TestPodDiscoveryDeleteUnknownCacheState(t *testing.T) {
func TestPodDiscoveryUpdate(t *testing.T) {
n, i := makeTestPodDiscovery()
i.GetStore().Add(&v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testpod",
Namespace: "default",
},
Expand Down
4 changes: 2 additions & 2 deletions discovery/kubernetes/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/util/strutil"
"golang.org/x/net/context"
apiv1 "k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
apiv1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

// Service implements discovery of Kubernetes services.
Expand Down
9 changes: 5 additions & 4 deletions discovery/kubernetes/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/tools/cache"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/cache"
)

func serviceStoreKeyFunc(obj interface{}) (string, error) {
Expand All @@ -39,7 +40,7 @@ func makeTestServiceDiscovery() (*Service, *fakeInformer) {

func makeMultiPortService() *v1.Service {
return &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "testservice",
Namespace: "default",
Labels: map[string]string{"testlabel": "testvalue"},
Expand All @@ -64,7 +65,7 @@ func makeMultiPortService() *v1.Service {

func makeSuffixedService(suffix string) *v1.Service {
return &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("testservice%s", suffix),
Namespace: "default",
},
Expand Down
22 changes: 0 additions & 22 deletions vendor/github.com/blang/semver/LICENSE

This file was deleted.

23 changes: 0 additions & 23 deletions vendor/github.com/blang/semver/json.go

This file was deleted.

Loading

0 comments on commit 0c34627

Please sign in to comment.