-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #673 from micw523/yaml-list
Extend YAML load functionality to *LIST and multi-resources
- Loading branch information
Showing
14 changed files
with
657 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"kind":"ServiceList", | ||
"apiVersion":"v1", | ||
"items":[ | ||
{ | ||
"metadata":{ | ||
"name":"mock-3", | ||
"labels":{ | ||
"app":"mock-3" | ||
} | ||
}, | ||
"spec":{ | ||
"ports": [{ | ||
"protocol": "TCP", | ||
"port": 99, | ||
"targetPort": 9949 | ||
}], | ||
"selector":{ | ||
"app":"mock-3" | ||
} | ||
} | ||
}, | ||
{ | ||
"metadata":{ | ||
"name":"mock-3", | ||
"labels":{ | ||
"app":"mock-3" | ||
} | ||
}, | ||
"spec":{ | ||
"ports": [{ | ||
"protocol": "TCP", | ||
"port": 99, | ||
"targetPort": 9949 | ||
}], | ||
"selector":{ | ||
"app":"mock-3" | ||
} | ||
} | ||
}, | ||
{ | ||
"metadata":{ | ||
"name":"mock-4", | ||
"labels":{ | ||
"app":"mock-4" | ||
} | ||
}, | ||
"spec":{ | ||
"ports": [{ | ||
"protocol": "TCP", | ||
"port": 99, | ||
"targetPort": 9949 | ||
}], | ||
"selector":{ | ||
"app":"mock-4" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: list-service-test | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
selector: | ||
app: list-deployment-test | ||
- apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: list-deployment-test | ||
labels: | ||
app: list-deployment-test | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: list-deployment-test | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx |
47 changes: 47 additions & 0 deletions
47
kubernetes/e2e_test/test_yaml/multi-resource-with-list.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: v1 | ||
kind: PodList | ||
items: | ||
- apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: mock-pod-0 | ||
labels: | ||
app: mock-pod-0 | ||
spec: | ||
containers: | ||
- name: mock-pod-0 | ||
image: busybox | ||
command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600'] | ||
- apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: mock-pod-1 | ||
labels: | ||
app: mock-pod-1 | ||
spec: | ||
containers: | ||
- name: mock-pod-1 | ||
image: busybox | ||
command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600'] | ||
--- | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: mock | ||
labels: | ||
app: mock | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: mock | ||
template: | ||
metadata: | ||
labels: | ||
app: mock | ||
spec: | ||
containers: | ||
- name: mock | ||
image: nginx:1.15.4 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mock | ||
labels: | ||
app: mock | ||
spec: | ||
ports: | ||
- port: 99 | ||
protocol: TCP | ||
targetPort: 9949 | ||
selector: | ||
app: mock | ||
--- | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
name: mock | ||
spec: | ||
replicas: 1 | ||
selector: | ||
app: mock | ||
template: | ||
metadata: | ||
labels: | ||
app: mock | ||
spec: | ||
containers: | ||
- name: mock-container | ||
image: k8s.gcr.io/pause:2.0 | ||
ports: | ||
- containerPort: 9949 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: NamespaceList | ||
items: | ||
- apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: mock-1 | ||
labels: | ||
name: mock-1 | ||
- apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: mock-2 | ||
labels: | ||
name: mock-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: triple-nginx | ||
spec: | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: triple-nginx | ||
spec: | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: triple-nginx | ||
spec: | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.7.9 | ||
ports: | ||
- containerPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mock-2 | ||
labels: | ||
app: mock-2 | ||
spec: | ||
ports: | ||
- port: 99 | ||
protocol: TCP | ||
targetPort: 9949 | ||
selector: | ||
app: mock-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mock-2 | ||
labels: | ||
app: mock-2 | ||
spec: | ||
ports: | ||
- port: 99 | ||
protocol: TCP | ||
targetPort: 9949 | ||
selector: | ||
app: mock-2 | ||
--- | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
metadata: | ||
name: mock-2 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
app: mock-2 | ||
template: | ||
metadata: | ||
labels: | ||
app: mock-2 | ||
spec: | ||
containers: | ||
- name: mock-container | ||
image: k8s.gcr.io/pause:2.0 | ||
ports: | ||
- containerPort: 9949 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.