mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Update cAdvisor ContainerInfo references to v1 API.
The cAdvisor data structures were versioned recently. We use the v1 versions so this commit makes that explicit.
This commit is contained in:
		@@ -25,7 +25,7 @@ import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	"github.com/google/cadvisor/info"
 | 
			
		||||
	info "github.com/google/cadvisor/info/v1"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type ContainerInfoGetter interface {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,8 +28,8 @@ import (
 | 
			
		||||
	"testing"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/google/cadvisor/info"
 | 
			
		||||
	itest "github.com/google/cadvisor/info/test"
 | 
			
		||||
	info "github.com/google/cadvisor/info/v1"
 | 
			
		||||
	itest "github.com/google/cadvisor/info/v1/test"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func testHTTPContainerInfoGetter(
 | 
			
		||||
@@ -62,7 +62,7 @@ func testHTTPContainerInfoGetter(
 | 
			
		||||
		// So changing req after Get*Info would be a race.
 | 
			
		||||
		expectedReq := req
 | 
			
		||||
		// Fill any empty fields with default value
 | 
			
		||||
		if !reflect.DeepEqual(expectedReq, &receivedReq) {
 | 
			
		||||
		if !expectedReq.Equals(receivedReq) {
 | 
			
		||||
			t.Errorf("received wrong request")
 | 
			
		||||
		}
 | 
			
		||||
		err = json.NewEncoder(w).Encode(cinfo)
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ import (
 | 
			
		||||
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/dockertools"
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
 | 
			
		||||
	cadvisor "github.com/google/cadvisor/info"
 | 
			
		||||
	cadvisor "github.com/google/cadvisor/info/v1"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ import (
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
 | 
			
		||||
	"github.com/fsouza/go-dockerclient"
 | 
			
		||||
	"github.com/google/cadvisor/info"
 | 
			
		||||
	info "github.com/google/cadvisor/info/v1"
 | 
			
		||||
	"github.com/stretchr/testify/mock"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ import (
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/httpstream"
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/httpstream/spdy"
 | 
			
		||||
	"github.com/golang/glog"
 | 
			
		||||
	"github.com/google/cadvisor/info"
 | 
			
		||||
	info "github.com/google/cadvisor/info/v1"
 | 
			
		||||
	"github.com/prometheus/client_golang/prometheus"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ import (
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/httpstream"
 | 
			
		||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/util/httpstream/spdy"
 | 
			
		||||
	"github.com/google/cadvisor/info"
 | 
			
		||||
	info "github.com/google/cadvisor/info/v1"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type fakeKubelet struct {
 | 
			
		||||
@@ -210,7 +210,7 @@ func TestContainerInfo(t *testing.T) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("received invalid json data: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	if !reflect.DeepEqual(&receivedInfo, expectedInfo) {
 | 
			
		||||
	if !receivedInfo.Eq(expectedInfo) {
 | 
			
		||||
		t.Errorf("received wrong data: %#v", receivedInfo)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -240,7 +240,7 @@ func TestContainerInfoWithUidNamespace(t *testing.T) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("received invalid json data: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	if !reflect.DeepEqual(&receivedInfo, expectedInfo) {
 | 
			
		||||
	if !receivedInfo.Eq(expectedInfo) {
 | 
			
		||||
		t.Errorf("received wrong data: %#v", receivedInfo)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -281,7 +281,7 @@ func TestRootInfo(t *testing.T) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("received invalid json data: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	if !reflect.DeepEqual(&receivedInfo, expectedInfo) {
 | 
			
		||||
	if !receivedInfo.Eq(expectedInfo) {
 | 
			
		||||
		t.Errorf("received wrong data: %#v", receivedInfo)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user