Right now, the way how gcp plugin handle name, resource_id when create resource on gcp is not consistent across all gcp nodes. The following issues must be fixed :
-
Each resource on the gcp which has name should be added as a runtime property whenever the resource is created on the gco platform and the name value should match the resource_id. This requires to check every gcp node type that has name attribute to follow this convention
-
Each resource that has a name value must normalized the name value before updating it as runtime property and this can be done using the following method helper name = utils.get_gcp_resource_name(name)
-
The resource that does not have a name must be updated to use cloudify instance id after get normalized like the following name = utils.get_gcp_resource_name(ctx.instance.id) and this must be consistent for all nodes type that does not have name attribute
-
When use_external_resource is enabled, we need to double check that the name passed to GCP resource will not be normalized since the provided name at this case must be match the name on the gcp provider without any modification/update to the name For example there are some resource call utils.get_gcp_resource_name(name) inside the Resource class like : SubNetwork https://github.com/cloudify-cosmo/cloudify-gcp-plugin/blob/master/cloudify_gcp/compute/subnetwork.py#L50
We need to check all resources and do a test for that
Right now, the way how gcp plugin handle
name,resource_idwhen create resource on gcp is not consistent across all gcp nodes. The following issues must be fixed :Each resource on the gcp which has name should be added as a runtime property whenever the resource is created on the gco platform and the
namevalue should match theresource_id. This requires to check every gcp node type that hasnameattribute to follow this conventionEach resource that has a
namevalue must normalized the name value before updating it as runtime property and this can be done using the following method helpername = utils.get_gcp_resource_name(name)The resource that does not have a name must be updated to use cloudify instance id after get normalized like the following
name = utils.get_gcp_resource_name(ctx.instance.id)and this must be consistent for all nodes type that does not have name attributeWhen
use_external_resourceis enabled, we need to double check that the name passed to GCP resource will not be normalized since the provided name at this case must be match the name on the gcp provider without any modification/update to the name For example there are some resource callutils.get_gcp_resource_name(name)inside the Resource class like :SubNetworkhttps://github.com/cloudify-cosmo/cloudify-gcp-plugin/blob/master/cloudify_gcp/compute/subnetwork.py#L50We need to check all resources and do a test for that