GoogleCloudPlatform / GoogleCloudPlatform/datashare-toolkit
Deployment Manager Python Bug
- Dominant language
- JavaScript
- Stars
- 94
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
This is a bug that needs to be filed with the Marketplace/Deployment Manager team.
I receive the following error when I attempt to pass the cluster version as a string to the cluster.py file.

I've tried a couple of different iterations to ensure that clusterVersion is a string when its passed to cluster.py, but it continues to generate the error above.
```
cluster_version = '' + str(context.properties['clusterVersion']) + ''
```
```
cluster_version_num = context.properties['clusterVersion'] # this causes an error
cluster_version = '' + str(cluster_version_num) + ''
```
clusterVersion is marked as a string in cluster.py.schema.
```
properties:
clusterVersion:
type: string
description: Initial number of nodes desired in the cluster.
default: "1.18"
```
I pass the cluster version from datashare-vm.jinja as shown below.
```
- name: datashare-cluster-manager
type: cluster.py
metadata:
dependsOn:
- {{ project }}{{ installStorageBucketSuffix }}
- delete-api
properties:
zone: {{ gkeZone }}
clusterVersion: {{ clusterVersion }}
```
clusterVersion is set as:
```
{% set clusterVersion = "1.18" %}
```
In spite of this configuration it continues to generate the error above. I've seen a similar error for a different property before, and it seems that there is some bug related to type handling in Jinja/Python.
However, it works when I remove `clusterVersion` from the `datashare-vm.jinja` file.

As long as I don't set the `clusterVersion` within `datashare-vm.jinja`, then the default version (1.18) listed in the `cluster.py.schema` file is used and the correct data type appears to be correct as well.
The current workaround is to update the default cluster version in the `cluster.py.schema` file until Deployment Manager team resolves the bug.
Contributor guide
Assessment
This issue has not been assessed yet.