Closed laurentganne closed 4 years ago
Code Climate has analyzed commit 6a5120a2 and detected 2 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 2 |
View more on Code Climate.
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities (and 0 Security Hotspots to review)
1 Code Smell
62.5% Coverage
0.0% Duplication
The version of Java (1.8.0_151) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. Read more here
Pull Request description
Description of the change
The OpenStack API provides a Compute Instance property metadata allowing a user to define key/value pairs at instance creation, and these key/value pairs will then be available from within the instance. Added the corresponding property in Yorc TOSCA type for OpenStack compute instances.
What I did
data/tosca/yorc-openstack-types.yml
Added the propertymetdata
to the TOSCA typeyorc.nodes.openstack.Compute
prov/terraform/openstack/osinstance.go
Getting the compute instance metadata value from the topologyprov/terraform/openstack/osinstance_test.go
Added a test on this new propertyprov/terraform/openstack/resources.go
Added a field Metadata to the golang type used for an OpenStack Compute instanceprov/terraform/openstack/testdata/simpleOSInstance.yaml
Added the new property in a topoly used in testsHow to verify it
Bootstrap a setup on OpenStack using an inputs file specifying a download URL of a Yorc distribution with this pull request code, and using a
yorc_plugin
download URL of an alien4cloud-yorc-provder containing the code from pull request https://github.com/alien4cloud/alien4cloud-yorc-provider/pull/23Then, from Alien4Cloud,edit the OpenStack on-demand compute instance property
metadata
to add this key/value pair:Then upload in Alien4Cloud catalog this application template: that will define 2 key/value pairs in the metadata:
Create an application from this template and deploy it on OpenStack. Once the application is deployed, you can either use the OpenStack console, select the created compute instance and check the metadata, or you can login on the compute instance, and run the follwing commands.
First run this command to get the list of openstack metata API supported versions:
Then get the metadata using the latest API version, and format the output
Check the meta section provide the key/pair values that we had specified in the application template.
Description for the changelog
Add the ability to define OpenStack Compute Instance metadata (GH-687)
Applicable Issues
Closes #687