adapt create_vm and attach_disk call for new cpi version 3#2633
Merged
adapt create_vm and attach_disk call for new cpi version 3#2633
Conversation
Ivaylogi98
approved these changes
Oct 20, 2025
anshrupani
approved these changes
Oct 21, 2025
Contributor
|
I see that the change done 7 years ago was to overcome the error "undefined method cid' for nil:NilClass" when the director does not support the CPI version, but they already have included unit tests for that, and are taking the minimum version supported_cpi_version = [cpi_api_version, MAX_SUPPORTED_CPI_VERSION].min into account. So I think it should be OK to get rid of the case statement. |
a-hassanin
approved these changes
Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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