-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add StripVolumeRegex configuration property #311
Conversation
if idpr.stripVolumeRegex != "" && idpr.stripVolumeCompiled == nil { | ||
idpr.stripVolumeCompiled, err = regexp.Compile(idpr.stripVolumeRegex) | ||
if err != nil { | ||
return "", false, bosherr.WrapError(err, "Compiling stripVolumeRegex") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have a function called like stripVolumeIfRequired
which does everything and returns a striped ID or not if not required. The current implementation of stripDiskID
function doesn't strip always the diskID which is not incorporated in the name. The function will need to return also error so that we fail in case the Compilation is not possible like it is implemented now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beyhan Done. I've renamed the function made the requested changes.
The change looks good. One open question is whether we need integration tests for it. I couldn't find any ITs for this kind of functionality. |
as we currently only do bats testing on gcp. i don't know if this pr actually solves it for this. |
We want to make use of this only on AWS and Ali for now. On GCP stripping disk IDs isn't required. I was thinking for agent integration tests and not bosh. |
There are some integration test helpers like AttachDevice which could be helpful when adding an integration test. |
Hi, one question, is this change considering the Openstack Env?, because I have a similar issue described here #310 (comment) and I would like to know if I need to wait or there is a workaround that I have to look for. Thanks in advance, David |
Regarding the IT discussion: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to add the integration test as I described it in my previous comment.
@beyhan After examining |
Ok, I looked into the wrong tests. Looking into the right tests I think an integration test will be challenging to implement here because the agent handles the resolution internally during the update_setttings action. The only way to validate from outside that the id_device_path_resolver.go provider was used, is via logs which is error prone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We agreed to go without integration tests.
Add a
StripVolumeRegex
configuration property that will be used to strip some part ofdisk-id
(aka volume ID) before device path resolve step, as proposed by the Working Group:Create a configuration property for the bosh agent to configure a strip-volume-regex,
which would allow specifying a regex prefix per IaaS in the bosh stemcell builder here (in the case of Ali Cloud).
The potential benefit is that this could solve issue #310.