GoogleCloudPlatform / GoogleCloudPlatform/datashare-toolkit

Deployment Manager Python Bug

Open
#508 0 comments 0 reactions 0 assignees View on GitHub
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.
![image](https://user-images.githubusercontent.com/5075006/120809223-7602ac00-c50f-11eb-907d-a92fbcfbd4ab.png)

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.
![image](https://user-images.githubusercontent.com/5075006/120811504-a6e3e080-c511-11eb-8445-abfbb0728a14.png)
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.