mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 07:03:31 +00:00
Propagate rename; tests pass again.
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user