diff options
author | 2019-07-03 11:13:25 -0400 | |
---|---|---|
committer | 2019-07-17 10:07:18 -0400 | |
commit | 91f452a988c05fc901a5b4ca0ac76eefb6be3a3c (patch) | |
tree | 9e7da92ec82b42da5bfe07ec497ac507187a6a62 /k8s/k8sclient/k8sclient.py | |
parent | 9c094d0581c46d3d107facdc55cb2cc7a1d9f765 (diff) |
Move DR subscriber creation before container start5.0.2-ONAP5.0.1-ONAPelalto
Also update Kubernetes client library version
Fix bug that allowed generating a too-long k8s deployment name.
Issue-ID: DCAEGEN2-1651
Issue-ID: DCAEGEN2-1653
Issue-ID: DCAEGEN2-1667
Change-Id: Ied859073fb01d8623278cf9e58c1dcc26fed1712
Signed-off-by: Jack Lucas <jflucas@research.att.com>
Diffstat (limited to 'k8s/k8sclient/k8sclient.py')
-rw-r--r-- | k8s/k8sclient/k8sclient.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/k8s/k8sclient/k8sclient.py b/k8s/k8sclient/k8sclient.py index 273b9f3..9a01536 100644 --- a/k8s/k8sclient/k8sclient.py +++ b/k8s/k8sclient/k8sclient.py @@ -43,10 +43,10 @@ FACTORS = {None: 1, "s": 1, "m": 60, "h": 3600} PORTS = re.compile("^([0-9]+)(/(udp|UDP|tcp|TCP))?:([0-9]+)$") def _create_deployment_name(component_name): - return "dep-{0}".format(component_name) + return "dep-{0}".format(component_name)[:63] def _create_service_name(component_name): - return "{0}".format(component_name) + return "{0}".format(component_name)[:63] def _create_exposed_service_name(component_name): return ("x{0}".format(component_name))[:63] @@ -545,7 +545,7 @@ def deploy(namespace, component_name, image, replicas, always_pull, k8sconfig, r core.delete_namespaced_service(_create_service_name(component_name), namespace) # If the deployment was created but not the service, delete the deployment if deployment_ok: - client.ExtensionsV1beta1Api().delete_namespaced_deployment(_create_deployment_name(component_name), namespace, client.V1DeleteOptions()) + client.ExtensionsV1beta1Api().delete_namespaced_deployment(_create_deployment_name(component_name), namespace, body=client.V1DeleteOptions()) raise e return dep, deployment_description @@ -561,7 +561,7 @@ def undeploy(deployment_description): # Have k8s delete the underlying pods and replicaset when deleting the deployment. options = client.V1DeleteOptions(propagation_policy="Foreground") - client.ExtensionsV1beta1Api().delete_namespaced_deployment(deployment_description["deployment"], namespace, options) + client.ExtensionsV1beta1Api().delete_namespaced_deployment(deployment_description["deployment"], namespace, body=options) def is_available(location, namespace, component_name): _configure_api(location) |