Skip to content

Commit

Permalink
Fork API types.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Jul 25, 2014
1 parent cb28f25 commit bf5ae4b
Show file tree
Hide file tree
Showing 15 changed files with 1,251 additions and 76 deletions.
1 change: 1 addition & 0 deletions api/examples/controller.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "nginxController",
"apiVersion": "v1beta1",
"desiredState": {
"replicas": 2,
"replicaSelector": {"name": "nginx"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func runAtomicPutTest(c *client.Client) {
var svc api.Service
err := c.Post().Path("services").Body(
api.Service{
JSONBase: api.JSONBase{ID: "atomicService"},
JSONBase: api.JSONBase{ID: "atomicService", APIVersion: "v1beta1"},
Port: 12345,
Labels: map[string]string{
"name": "atomicService",
Expand Down
4 changes: 2 additions & 2 deletions hack/test-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ KUBE_COVER="-cover -covermode=atomic -coverprofile=\"tmp.out\""
cd "${KUBE_TARGET}"

if [ "$1" != "" ]; then
go test -race $KUBE_COVER "$KUBE_GO_PACKAGE/$1" "${@:2}"
go test -race -timeout 30s $KUBE_COVER "$KUBE_GO_PACKAGE/$1" "${@:2}"
exit 0
fi

for package in $(find_test_dirs); do
go test -race $KUBE_COVER "${KUBE_GO_PACKAGE}/${package}" "${@:2}"
go test -race -timeout 30s $KUBE_COVER "${KUBE_GO_PACKAGE}/${package}" "${@:2}"
done
7 changes: 5 additions & 2 deletions pkg/api/apiobj_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ func TestAPIObject(t *testing.T) {
Object APIObject `yaml:"object,omitempty" json:"object,omitempty"`
EmptyObject APIObject `yaml:"emptyObject,omitempty" json:"emptyObject,omitempty"`
}

AddKnownTypes(EmbeddedTest{})
convert := func(obj interface{}) (interface{}, error) { return obj, nil }
AddKnownTypes("", EmbeddedTest{})
AddKnownTypes("v1beta1", EmbeddedTest{})
AddExternalConversion("EmbeddedTest", convert)
AddInternalConversion("EmbeddedTest", convert)

outer := &EmbeddedTest{
JSONBase: JSONBase{ID: "outer"},
Expand Down
Loading

0 comments on commit bf5ae4b

Please sign in to comment.