allow kubectl subcmds to process multiple resources

- use resource.Visit() to recursively process resources, as well as, aggregate
errors where possible
This commit is contained in:
Mike Metral
2016-04-14 15:00:40 -07:00
parent 9a871ed554
commit 999c8e211e
19 changed files with 676 additions and 231 deletions

View File

@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
ind: Deployment
metadata:
name: nginx2-deployment
labels:
app: nginx2-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx2
spec:
containers:
- name: nginx
image: gcr.io/google-containers/nginx:1.7.9
ports:
- containerPort: 80

View File

@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx1-deployment
labels:
app: nginx1-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx1
spec:
containers:
- name: nginx
image: gcr.io/google-containers/nginx:1.7.9
ports:
- containerPort: 80

View File

@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx0-deployment
labels:
app: nginx0-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx0
spec:
containers:
- name: nginx
image: gcr.io/google-containers/nginx:1.7.9
ports:
- containerPort: 80

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox0
labels:
app: busybox0
status: replaced
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,16 @@
apiVersion: v1
ind: Pod
metadata:
name: busybox2
labels:
app: busybox2
status: replaced
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox1
labels:
app: busybox1
status: replaced
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox0
labels:
app: busybox0
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,15 @@
apiVersion: v1
ind: Pod
metadata:
name: busybox2
labels:
app: busybox2
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox1
labels:
app: busybox1
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

24
hack/testdata/recursive/rc/busybox.yaml vendored Normal file
View File

@@ -0,0 +1,24 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: busybox0
labels:
app: busybox0
spec:
replicas: 1
selector:
app: busybox0
template:
metadata:
name: busybox0
labels:
app: busybox0
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,24 @@
apiVersion: v1
ind: ReplicationController
metadata:
name: busybox2
labels:
app: busybox2
spec:
replicas: 1
selector:
app: busybox2
template:
metadata:
name: busybox2
labels:
app: busybox2
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always

View File

@@ -0,0 +1,24 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: busybox1
labels:
app: busybox1
spec:
replicas: 1
selector:
app: busybox1
template:
metadata:
name: busybox1
labels:
app: busybox1
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always