add comment on 63 label length, fix _parse_volumes 49/82749/2
authorJason Luo <cl4531@att.com>
Wed, 20 Mar 2019 01:04:13 +0000 (01:04 +0000)
committerJason Luo <cl4531@att.com>
Fri, 22 Mar 2019 13:52:00 +0000 (13:52 +0000)
change to v['container'].get('mode') to allow mode value be absent

Issue-ID: DCAEGEN2-1126

Change-Id: I12fe257995f466238f64b06e6cf80f3cc2654c5b
Signed-off-by: Jason Luo <cl4531@att.com>
k8s/ChangeLog.md
k8s/k8s-node-type.yaml
k8s/k8sclient/k8sclient.py
k8s/k8splugin/tasks.py
k8s/setup.py

index 4faaaf7..2511802 100644 (file)
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## [1.4.11]
+ change v['container']['mode'] to v['container'].get('mode') to allow for
+ the 'mode' value to be absent from v['container']
+ add comment: The name segment is required and must be 63 characters or less
+ (https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/)
+
 ## [1.4.10]
  Support for deploying to multiple Kubernetes clusters.
 
index 5a19e8a..f47a2bc 100644 (file)
@@ -25,7 +25,7 @@ plugins:
   k8s:
     executor: 'central_deployment_agent'
     package_name: k8splugin
-    package_version: 1.4.10
+    package_version: 1.4.11
 
 data_types:
 
index ee4250d..3a02efd 100644 (file)
@@ -267,7 +267,7 @@ def _parse_volumes(volume_list):
         vname = str(uuid.uuid4())
         vhost = v['host']['path']
         vcontainer = v['container']['bind']
-        vro = (v['container']['mode'] == 'ro')
+        vro = (v['container'].get('mode') == 'ro')
         volumes.append(client.V1Volume(name=vname, host_path=client.V1HostPathVolumeSource(path=vhost)))
         volume_mounts.append(client.V1VolumeMount(name=vname, mount_path=vcontainer, read_only=vro))
 
index fdb00c5..b8669e2 100644 (file)
@@ -338,6 +338,7 @@ def _parse_cloudify_context(**kwargs):
     kwargs["deployment_id"] = ctx.deployment.id
 
     # Set some labels for the Kubernetes pods
+    # The name segment is required and must be 63 characters or less
     kwargs["labels"] = {
         "cfydeployment" : ctx.deployment.id,
         "cfynode": ctx.node.name[:63],
@@ -545,6 +546,7 @@ def create_and_start_container_for_platforms(**kwargs):
         service_component_name = ctx.node.properties["name"]
 
     # Set some labels for the Kubernetes pods
+    # The name segment is required and must be 63 characters or less
     kwargs["labels"] = {
         "cfydeployment" : ctx.deployment.id,
         "cfynode": ctx.node.name[:63],
index 12f1f5e..bfe213c 100644 (file)
@@ -23,7 +23,7 @@ from setuptools import setup
 setup(
     name='k8splugin',
     description='Cloudify plugin for containerized components deployed using Kubernetes',
-    version="1.4.10",
+    version="1.4.11",
     author='J. F. Lucas, Michael Hwang, Tommy Carpenter',
     packages=['k8splugin','k8sclient','msb','configure'],
     zip_safe=False,