Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID Device path resolver #343

Merged
merged 14 commits into from
Jan 16, 2025
Merged

ID Device path resolver #343

merged 14 commits into from
Jan 16, 2025

Conversation

ramonskie
Copy link
Contributor

we noticed that the id device path resolver code path always did a fallback to other mechanisms to mount the disk.
and this was due to the fact that the DiskID provided by the agent never matched the actual disk.

with this change you can now add regex patterns and replacements in the agent.json to match the expected disk-id

for example AWS:
provides the disk id as vol-04b2a40747d7e9625 but the actuall disk path is /dev/disks/by-id/nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625

and if we place the following in the agent.json

"DiskIDTransformPattern": "^(vol-(.+))$",
"DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${2}"

it would be transformed to vme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625

@ramonskie ramonskie requested review from a team, anshrupani and klakin-pivotal and removed request for a team December 20, 2024 11:09
@ramonskie ramonskie changed the title [WIP] ID Device path resolver ID Device path resolver Dec 20, 2024
@rkoster rkoster requested review from jpalermo and fmoehler January 9, 2025 15:54
Copy link
Member

@jpalermo jpalermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// Regular expression specifying what part of disk ID to strip and transform
// example: "pattern": "^(disk-.+)$", "replacement": "google-${1}",
DiskIDTransformPattern string
DiskIDTransformReplacement string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, bosh.io links to golang docs that document these flags

@beyhan beyhan merged commit 29b4d4d into main Jan 16, 2025
12 checks passed
@beyhan beyhan deleted the device_path_resolver branch January 16, 2025 16:30
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.

None yet

5 participants