Propagate rename; tests pass again.

This commit is contained in:
Daniel Smith
2014-08-31 22:10:49 -07:00
parent 7615c00a9a
commit 099c8fd36f
35 changed files with 183 additions and 151 deletions

View File

@@ -22,6 +22,7 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apitools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
"github.com/coreos/go-etcd/etcd"
@@ -35,7 +36,7 @@ func TestGetEtcdData(t *testing.T) {
fakeClient.Data["/registry/hosts/machine/kubelet"] = tools.EtcdResponseWithError{
R: &etcd.Response{
Node: &etcd.Node{
Value: api.EncodeOrDie(&api.ContainerManifestList{
Value: apitools.EncodeOrDie(&api.ContainerManifestList{
Items: []api.ContainerManifest{{ID: "foo"}},
}),
ModifiedIndex: 1,
@@ -78,7 +79,7 @@ func TestGetEtcd(t *testing.T) {
fakeClient.Data["/registry/hosts/machine/kubelet"] = tools.EtcdResponseWithError{
R: &etcd.Response{
Node: &etcd.Node{
Value: api.EncodeOrDie(&api.ContainerManifestList{
Value: apitools.EncodeOrDie(&api.ContainerManifestList{
Items: []api.ContainerManifest{manifest},
}),
ModifiedIndex: 1,
@@ -112,7 +113,7 @@ func TestWatchEtcd(t *testing.T) {
fakeClient.Data["/registry/hosts/machine/kubelet"] = tools.EtcdResponseWithError{
R: &etcd.Response{
Node: &etcd.Node{
Value: api.EncodeOrDie(&api.ContainerManifestList{}),
Value: apitools.EncodeOrDie(&api.ContainerManifestList{}),
ModifiedIndex: 2,
},
},

View File

@@ -24,6 +24,7 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
@@ -69,7 +70,7 @@ func (s *SourceURL) extractFromURL() error {
var manifest api.ContainerManifest
singleErr := yaml.Unmarshal(data, &manifest)
if singleErr == nil {
if errs := api.ValidateManifest(&manifest); len(errs) > 0 {
if errs := validation.ValidateManifest(&manifest); len(errs) > 0 {
singleErr = fmt.Errorf("invalid manifest: %v", errs)
}
}
@@ -90,7 +91,7 @@ func (s *SourceURL) extractFromURL() error {
// done at the end. Hence not returning early here.
if multiErr == nil {
for _, manifest := range manifests {
if errs := api.ValidateManifest(&manifest); len(errs) > 0 {
if errs := validation.ValidateManifest(&manifest); len(errs) > 0 {
multiErr = fmt.Errorf("invalid manifest: %v", errs)
break
}