forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add all-namespaces flag to svcat (openshift#1782)
* Closes openshift#1766 * Add all-namespaces flag to svcat get bindings/instances commands When set retrieves all bindings/instances across namespaces, overriding the value of the ns flag. * Add tests for all-namespaces flag Add testdata and tests for both `svcat get bindings --all-namespaces` and `svcat get instances --all-namespaces`
- Loading branch information
Showing
13 changed files
with
490 additions
and
5 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
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
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
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,4 @@ | ||
NAME NAMESPACE INSTANCE STATUS | ||
+-------------+-----------+--------------+--------+ | ||
ups-binding test-ns ups-instance Ready | ||
ups-binding default ups-instance Ready |
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,4 @@ | ||
NAME NAMESPACE CLASS PLAN STATUS | ||
+--------------+-----------+-----------------------+---------+--------+ | ||
ups-instance test-ns user-provided-service default Ready | ||
ups-instance default user-provided-service default Ready |
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
51 changes: 51 additions & 0 deletions
51
cmd/svcat/testdata/responses/namespaces/default/servicebindings.json
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,51 @@ | ||
{ | ||
"kind": "ServiceBindingList", | ||
"apiVersion": "servicecatalog.k8s.io/v1beta1", | ||
"metadata": { | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/default/servicebindings", | ||
"resourceVersion": "121" | ||
}, | ||
"items": [ | ||
{ | ||
"metadata": { | ||
"name": "ups-binding", | ||
"namespace": "default", | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/default/servicebindings/ups-binding", | ||
"uid": "456aefa0-f712-11e7-aa44-0242ac110005", | ||
"resourceVersion": "16", | ||
"generation": 1, | ||
"creationTimestamp": "2018-01-11T21:00:47Z", | ||
"finalizers": [ | ||
"kubernetes-incubator/service-catalog" | ||
] | ||
}, | ||
"spec": { | ||
"instanceRef": { | ||
"name": "ups-instance" | ||
}, | ||
"parameters": {}, | ||
"secretName": "ups-binding", | ||
"externalID": "061e1d78-d27e-4958-97b8-e9f5aa2f99d7" | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"type": "Ready", | ||
"status": "True", | ||
"lastTransitionTime": "2018-01-11T21:00:47Z", | ||
"reason": "InjectedBindResult", | ||
"message": "Injected bind result" | ||
} | ||
], | ||
"asyncOpInProgress": false, | ||
"reconciledGeneration": 1, | ||
"externalProperties": { | ||
"parameters": {}, | ||
"parameterChecksum": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" | ||
}, | ||
"orphanMitigationInProgress": false, | ||
"unbindStatus": "Required" | ||
} | ||
} | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
cmd/svcat/testdata/responses/namespaces/default/servicebindings/ups-binding.json
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,43 @@ | ||
{ | ||
"kind": "ServiceBinding", | ||
"apiVersion": "servicecatalog.k8s.io/v1beta1", | ||
"metadata": { | ||
"name": "ups-binding", | ||
"namespace": "default", | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/default/servicebindings/ups-binding", | ||
"uid": "456aefa0-f712-11e7-aa44-0242ac110005", | ||
"resourceVersion": "16", | ||
"generation": 1, | ||
"creationTimestamp": "2018-01-11T21:00:47Z", | ||
"finalizers": [ | ||
"kubernetes-incubator/service-catalog" | ||
] | ||
}, | ||
"spec": { | ||
"instanceRef": { | ||
"name": "ups-instance" | ||
}, | ||
"parameters": {}, | ||
"secretName": "ups-binding", | ||
"externalID": "061e1d78-d27e-4958-97b8-e9f5aa2f99d7" | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"type": "Ready", | ||
"status": "True", | ||
"lastTransitionTime": "2018-01-11T21:00:47Z", | ||
"reason": "InjectedBindResult", | ||
"message": "Injected bind result" | ||
} | ||
], | ||
"asyncOpInProgress": false, | ||
"reconciledGeneration": 1, | ||
"externalProperties": { | ||
"parameters": {}, | ||
"parameterChecksum": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" | ||
}, | ||
"orphanMitigationInProgress": false, | ||
"unbindStatus": "Required" | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
cmd/svcat/testdata/responses/namespaces/default/serviceinstances.json
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,58 @@ | ||
{ | ||
"kind": "ServiceInstanceList", | ||
"apiVersion": "servicecatalog.k8s.io/v1beta1", | ||
"metadata": { | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/serviceinstances", | ||
"resourceVersion": "109" | ||
}, | ||
"items": [ | ||
{ | ||
"metadata": { | ||
"name": "ups-instance", | ||
"namespace": "default", | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/default/serviceinstances/ups-instance", | ||
"uid": "1237fd85-f712-11e7-aa44-0242ac110006", | ||
"resourceVersion": "13", | ||
"generation": 1, | ||
"creationTimestamp": "2018-01-11T20:59:47Z", | ||
"finalizers": [ | ||
"kubernetes-incubator/service-catalog" | ||
] | ||
}, | ||
"spec": { | ||
"clusterServiceClassExternalName": "user-provided-service", | ||
"clusterServicePlanExternalName": "default", | ||
"clusterServiceClassRef": { | ||
"name": "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" | ||
}, | ||
"clusterServicePlanRef": { | ||
"name": "86064792-7ea2-467b-af93-ac9694d96d52" | ||
}, | ||
"parameters": {}, | ||
"externalID": "7e2c42f3-6d94-4409-bb15-7610d60af544", | ||
"updateRequests": 0 | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"type": "Ready", | ||
"status": "True", | ||
"lastTransitionTime": "2018-01-11T20:59:47Z", | ||
"reason": "ProvisionedSuccessfully", | ||
"message": "The instance was provisioned successfully" | ||
} | ||
], | ||
"asyncOpInProgress": false, | ||
"orphanMitigationInProgress": false, | ||
"reconciledGeneration": 1, | ||
"externalProperties": { | ||
"clusterServicePlanExternalName": "default", | ||
"clusterServicePlanExternalID": "86064792-7ea2-467b-af93-ac9694d96d52", | ||
"parameters": {}, | ||
"parameterChecksum": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" | ||
}, | ||
"deprovisionStatus": "Required" | ||
} | ||
} | ||
] | ||
} |
50 changes: 50 additions & 0 deletions
50
cmd/svcat/testdata/responses/namespaces/default/serviceinstances/ups-instance.json
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 @@ | ||
{ | ||
"kind": "ServiceInstance", | ||
"apiVersion": "servicecatalog.k8s.io/v1beta1", | ||
"metadata": { | ||
"name": "ups-instance", | ||
"namespace": "default", | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/default/serviceinstances/ups-instance", | ||
"uid": "1237fd85-f712-11e7-aa44-0242ac110006", | ||
"resourceVersion": "13", | ||
"generation": 1, | ||
"creationTimestamp": "2018-01-11T20:59:47Z", | ||
"finalizers": [ | ||
"kubernetes-incubator/service-catalog" | ||
] | ||
}, | ||
"spec": { | ||
"clusterServiceClassExternalName": "user-provided-service", | ||
"clusterServicePlanExternalName": "default", | ||
"clusterServiceClassRef": { | ||
"name": "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" | ||
}, | ||
"clusterServicePlanRef": { | ||
"name": "86064792-7ea2-467b-af93-ac9694d96d52" | ||
}, | ||
"parameters": {}, | ||
"externalID": "7e2c42f3-6d94-4409-bb15-7610d60af544", | ||
"updateRequests": 0 | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"type": "Ready", | ||
"status": "True", | ||
"lastTransitionTime": "2018-01-11T20:59:47Z", | ||
"reason": "ProvisionedSuccessfully", | ||
"message": "The instance was provisioned successfully" | ||
} | ||
], | ||
"asyncOpInProgress": false, | ||
"orphanMitigationInProgress": false, | ||
"reconciledGeneration": 1, | ||
"externalProperties": { | ||
"clusterServicePlanExternalName": "default", | ||
"clusterServicePlanExternalID": "86064792-7ea2-467b-af93-ac9694d96d52", | ||
"parameters": {}, | ||
"parameterChecksum": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" | ||
}, | ||
"deprovisionStatus": "Required" | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
cmd/svcat/testdata/responses/namespaces/test-ns/serviceinstances/ups-binding.json
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,43 @@ | ||
{ | ||
"kind": "ServiceBinding", | ||
"apiVersion": "servicecatalog.k8s.io/v1beta1", | ||
"metadata": { | ||
"name": "ups-binding", | ||
"namespace": "test-ns", | ||
"selfLink": "/apis/servicecatalog.k8s.io/v1beta1/namespaces/test-ns/servicebindings/ups-binding", | ||
"uid": "7f2aefa0-f712-11e7-aa44-0242ac110005", | ||
"resourceVersion": "16", | ||
"generation": 1, | ||
"creationTimestamp": "2018-01-11T21:00:47Z", | ||
"finalizers": [ | ||
"kubernetes-incubator/service-catalog" | ||
] | ||
}, | ||
"spec": { | ||
"instanceRef": { | ||
"name": "ups-instance" | ||
}, | ||
"parameters": {}, | ||
"secretName": "ups-binding", | ||
"externalID": "061e1d78-d27e-4958-97b8-e9f5aa2f99d7" | ||
}, | ||
"status": { | ||
"conditions": [ | ||
{ | ||
"type": "Ready", | ||
"status": "True", | ||
"lastTransitionTime": "2018-01-11T21:00:47Z", | ||
"reason": "InjectedBindResult", | ||
"message": "Injected bind result" | ||
} | ||
], | ||
"asyncOpInProgress": false, | ||
"reconciledGeneration": 1, | ||
"externalProperties": { | ||
"parameters": {}, | ||
"parameterChecksum": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" | ||
}, | ||
"orphanMitigationInProgress": false, | ||
"unbindStatus": "Required" | ||
} | ||
} |
Oops, something went wrong.