Skip to content

Conversation

@fmoehler
Copy link
Contributor

@fmoehler fmoehler commented Oct 20, 2025

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

@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Oct 21, 2025
@a-hassanin
Copy link
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.

@fmoehler fmoehler merged commit a841f5b into main Oct 22, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Oct 22, 2025
@a-hassanin a-hassanin deleted the adapt-methods-for-new-cpi-version branch October 23, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants