From 4823b2acc5c61d5e5442364cd0540dd475949e73 Mon Sep 17 00:00:00 2001 From: Jason Luo Date: Wed, 20 Mar 2019 01:04:13 +0000 Subject: add comment on 63 label length, fix _parse_volumes change to v['container'].get('mode') to allow mode value be absent Issue-ID: DCAEGEN2-1126 Change-Id: I12fe257995f466238f64b06e6cf80f3cc2654c5b Signed-off-by: Jason Luo --- k8s/ChangeLog.md | 6 ++++++ k8s/k8s-node-type.yaml | 2 +- k8s/k8sclient/k8sclient.py | 2 +- k8s/k8splugin/tasks.py | 2 ++ k8s/setup.py | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/k8s/ChangeLog.md b/k8s/ChangeLog.md index 4faaaf7..2511802 100644 --- a/k8s/ChangeLog.md +++ b/k8s/ChangeLog.md @@ -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. diff --git a/k8s/k8s-node-type.yaml b/k8s/k8s-node-type.yaml index 5a19e8a..f47a2bc 100644 --- a/k8s/k8s-node-type.yaml +++ b/k8s/k8s-node-type.yaml @@ -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: diff --git a/k8s/k8sclient/k8sclient.py b/k8s/k8sclient/k8sclient.py index ee4250d..3a02efd 100644 --- a/k8s/k8sclient/k8sclient.py +++ b/k8s/k8sclient/k8sclient.py @@ -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)) diff --git a/k8s/k8splugin/tasks.py b/k8s/k8splugin/tasks.py index fdb00c5..b8669e2 100644 --- a/k8s/k8splugin/tasks.py +++ b/k8s/k8splugin/tasks.py @@ -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], diff --git a/k8s/setup.py b/k8s/setup.py index 12f1f5e..bfe213c 100644 --- a/k8s/setup.py +++ b/k8s/setup.py @@ -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, -- cgit 1.2.3-korg