adapt create_vm and attach_disk call for new cpi version 3 #2633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this change about?
Bosh director should handle all CPI API Versions correctly.
This will solve the failing BATS for the aws cpi: https://bosh.ci.cloudfoundry.org/teams/main/pipelines/bosh-aws-cpi/jobs/bats
Please provide contextual information.
The AWS CPI API Version was recently bumped to version 3. This leads to issues when the director tries to create a vm because the response is cleared unexpectedly as previously there is only handling for version 1 and 2. Back then the update to support version 3 was only done for the create_stemcell method. I changed this to be compatible with all versions higher than 2. To me this change appears pretty straightforward, however I could see that this coding was like this already in the past, but was changed to the case statement. This was done 7 years ago so probably the reason why this was changed is not valid anymore? Otherwise we could also change it back to a case statement instead just including version 3.
What tests have you run against this PR?
Unit Tests
How should this change be described in bosh release notes?
Introduce support for CPI API Versions higher than 2 for create_vm and attach_disk.
Does this PR introduce a breaking change?
No
Tag your pair, your PM, and/or team!
@Ivaylogi98