Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Deleting old sample JSON; moving those in use; updating referenc... #5198

Merged
merged 1 commit into from
Mar 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions api/examples/controller-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"kind": "ReplicationControllerList",
"apiVersion": "v1beta1",
"items": [
{
"id": "test-run",
"desiredState": {
"replicas": 2,
"replicaSelector": {
"name": "test-run"
},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta1",
"image": "dockerfile/nginx",
"networkPorts": [
{
"hostPort": 8080,
"containerPort": 80
}
]
}
},
"labels": {
"name": "test-run"
}
}
},
"labels": {
"name": "test-run"
}
}
]
}
File renamed without changes.
13 changes: 13 additions & 0 deletions api/examples/external-service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "example",
"kind": "Service",
"apiVersion": "v1beta1",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
},
"createExternalLoadBalancer": true
}
54 changes: 54 additions & 0 deletions api/examples/pod-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"kind": "PodList",
"apiVersion": "v1beta1",
"items": [
{
"id": "my-pod-1",
"labels": {
"name": "test-run",
"replicationcontroller": "test-run"
},
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "my-pod-1",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{
"hostPort": 8080,
"containerPort": 80
}]
}]
}
},
"currentState": {
"host": "host-1"
}
},
{
"id": "my-pod-2",
"labels": {
"name": "test-run",
"replicationcontroller": "test-run"
},
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "my-pod-2",
"containers": [{
"name": "nginx",
"image": "dockerfile/nginx",
"ports": [{
"hostPort": 8080,
"containerPort": 80
}]
}]
}
},
"currentState": {
"host": "host-2"
}
}
]
}
File renamed without changes.
28 changes: 28 additions & 0 deletions api/examples/service-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"kind": "ServiceList",
"apiVersion": "v1beta1",
"items": [
{
"id": "example1",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
},
{
"id": "example2",
"port": 8080,
"labels": {
"env": "prod",
"name": "jetty"
},
"selector": {
"env": "prod",
"name": "jetty"
}
}
]
}
12 changes: 12 additions & 0 deletions api/examples/service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"kind": "Service",
"apiVersion": "v1beta1",
"id": "example",
"port": 8000,
"labels": {
"name": "nginx"
},
"selector": {
"name": "nginx"
}
}
2 changes: 1 addition & 1 deletion cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func podExists(c *client.Client, podNamespace string, podID string) wait.Conditi
}

func runReplicationControllerTest(c *client.Client) {
data, err := ioutil.ReadFile("cmd/integration/controller.json")
data, err := ioutil.ReadFile("api/examples/controller.json")
if err != nil {
glog.Fatalf("Unexpected error: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can create a pod like this:

```
cd kubernetes
cluster/kubectl.sh create -f docs/getting-started-guides/pod.json
cluster/kubectl.sh create -f api/examples/pod.json
```

Where pod.json contains something like:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/gce.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ can create a pod like this:

```bash
cd kubernetes
cluster/kubectl.sh create -f docs/getting-started-guides/pod.json
cluster/kubectl.sh create -f api/examples/pod.json
```

Where pod.json contains something like:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ However you can't view the nginx start page on localhost. To verify that nginx i
You can control the specifications of a pod via a user defined manifest, and reach nginx through your browser on the port specified therein:

```
cluster/kubectl.sh create -f docs/getting-started-guides/pod.json
cluster/kubectl.sh create -f api/examples/pod.json
```

Congratulations!
Expand Down
13 changes: 8 additions & 5 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ func walkJSONFiles(inDir string, fn func(name, path string, data []byte)) error

func TestExampleObjectSchemas(t *testing.T) {
cases := map[string]map[string]runtime.Object{
"../docs/getting-started-guides": {
"pod": &api.Pod{},
},
"../cmd/integration": {
"controller": &api.ReplicationController{},
"../api/examples": {
"controller": &api.ReplicationController{},
"controller-list": &api.ReplicationControllerList{},
"pod": &api.Pod{},
"pod-list": &api.PodList{},
"service": &api.Service{},
"external-service": &api.Service{},
"service-list": &api.ServiceList{},
},
"../examples/guestbook": {
"frontend-controller": &api.ReplicationController{},
Expand Down