From a1cfec9bbe43dd005ab16792c90cc949555cce12 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 3 May 2017 18:14:16 -0600 Subject: add support for oc_service for labels, externalIPs Add support for `labels` and `externalIPs` in Services This also adds support for the `labels` parameter of `oadm registry` and `oadm router` to be a `dict` of values. This also converts `labels` dict values in the router and registry classes into a comma delimited list of `key=value` pairs. The list of `--labels` is sorted for consistency in key pair positioning in the output (and for consistency in testing) - otherwise, the order of the list is not guarantee and has actually been observed to be different from run to run. --- roles/lib_openshift/src/test/unit/test_oc_adm_registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'roles/lib_openshift/src/test/unit/test_oc_adm_registry.py') diff --git a/roles/lib_openshift/src/test/unit/test_oc_adm_registry.py b/roles/lib_openshift/src/test/unit/test_oc_adm_registry.py index 97cf86170..77787fe87 100755 --- a/roles/lib_openshift/src/test/unit/test_oc_adm_registry.py +++ b/roles/lib_openshift/src/test/unit/test_oc_adm_registry.py @@ -218,7 +218,7 @@ class RegistryTest(unittest.TestCase): 'kubeconfig': '/etc/origin/master/admin.kubeconfig', 'images': None, 'latest_images': None, - 'labels': None, + 'labels': {"docker-registry": "default", "another-label": "val"}, 'ports': ['5000'], 'replicas': 1, 'selector': 'type=infra', @@ -255,6 +255,7 @@ class RegistryTest(unittest.TestCase): mock.call(['oc', 'get', 'dc', 'docker-registry', '-o', 'json', '-n', 'default'], None), mock.call(['oc', 'get', 'svc', 'docker-registry', '-o', 'json', '-n', 'default'], None), mock.call(['oc', 'adm', 'registry', + "--labels=another-label=val,docker-registry=default", '--ports=5000', '--replicas=1', '--selector=type=infra', '--service-account=registry', '--dry-run=True', '-o', 'json', '-n', 'default'], None), mock.call(['oc', 'create', '-f', mock.ANY, '-n', 'default'], None), -- cgit v1.2.1