Add validation for node creation.

This commit is contained in:
Rohit Jnagal
2015-03-24 17:24:07 +00:00
parent f3ebe30605
commit 49ff04765b
7 changed files with 230 additions and 14 deletions

View File

@@ -24,6 +24,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest/resttest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
@@ -61,6 +62,13 @@ func validNewNode() *api.Node {
"name": "foo",
},
},
Spec: api.NodeSpec{
ExternalID: "external",
Capacity: api.ResourceList{
api.ResourceName(api.ResourceCPU): resource.MustParse("10"),
api.ResourceName(api.ResourceMemory): resource.MustParse("0"),
},
},
}
}