Skip to content

Commit

Permalink
Match changes to make []runtime.Object cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Apr 29, 2015
1 parent 9ce4824 commit 2325917
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions pkg/api/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func ValidateObject(obj runtime.Object) (errors []error) {
errors = templatev.ValidateTemplate(t)
default:
if list, err := runtime.ExtractList(obj); err == nil {
runtime.DecodeList(list, kapi.Scheme)
for i := range list {
errs := ValidateObject(list[i])
errors = append(errors, errs...)
Expand Down
6 changes: 3 additions & 3 deletions pkg/client/testclient/testclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
)

func TestNewClient(t *testing.T) {
o := testclient.NewObjects(kapi.Scheme)
if err := testclient.AddObjectsFromPath("../../../test/integration/fixtures/test-deployment-config.json", o); err != nil {
o := testclient.NewObjects(kapi.Scheme, kapi.Scheme)
if err := testclient.AddObjectsFromPath("../../../test/integration/fixtures/test-deployment-config.json", o, kapi.Scheme); err != nil {
t.Fatal(err)
}
osc, _ := NewFixtureClients(o)
Expand All @@ -37,7 +37,7 @@ func TestNewClient(t *testing.T) {
}

func TestErrors(t *testing.T) {
o := testclient.NewObjects(kapi.Scheme)
o := testclient.NewObjects(kapi.Scheme, kapi.Scheme)
o.Add(&kapi.List{
Items: []runtime.Object{
&(errors.NewNotFound("DeploymentConfigList", "").(*errors.StatusError).ErrStatus),
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cli/describe/projectstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ func TestProjectStatus(t *testing.T) {
}
return time.Now()
}
o := ktestclient.NewObjects(kapi.Scheme)
o := ktestclient.NewObjects(kapi.Scheme, kapi.Scheme)
if len(test.Path) > 0 {
if err := ktestclient.AddObjectsFromPath(test.Path, o); err != nil {
if err := ktestclient.AddObjectsFromPath(test.Path, o, kapi.Scheme); err != nil {
t.Fatal(err)
}
}
Expand Down

0 comments on commit 2325917

Please sign in to comment.