-
Notifications
You must be signed in to change notification settings - Fork 217
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
Provide option to enable volume mode conversion flag to HostPath driver deployment script #379
Conversation
166ae93
to
143e46a
Compare
deploy/util/deploy-hostpath.sh
Outdated
@@ -246,6 +250,10 @@ for i in $(ls ${BASE_DIR}/hostpath/*.yaml | sort); do | |||
fi | |||
echo "$line" | |||
done)" | |||
if volume_mode_conversion; then | |||
# Enable volume mode conversion feature flag | |||
modified="${modified//--prevent-volume-mode-conversion=false/--prevent-volume-mode-conversion=true}" |
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.
Is this line the reason why you need the --prevent-volume-mode-conversion=false
in the manifest files?
Then I suggest to either find a way to inject this parameter without relying on special markers in the YAML file (but I understand that this might be hard in pure shell), or use a generic marker like # end of snapshot-controller arguments
.
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.
Yes, I've tried to alter the flow of the script as little as possible. I've added start and end markers here, so that any future feature flags can be added in the same block.
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.
This is not what I meant 😅
I meant that # end of snapshot-controller arguments
should be in the YAML file, and then this script injects the new parameters at that line. That makes the changes to the YAML file more generic and it is more obvious that the line is special and better shouldn't get removed. That was not clear with the additional --prevent-volume-mode-conversion=false
.
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.
Aaaaaah, gotcha! I'll make those changes and test it out
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.
@pohly made some changes to the scripts and YAMLs. As you suggested, I've added a marker to the yaml and inject the arguments for the container if a variable is set. PTAL!
…t-volume-mode-conversion flag if VOLUME_MODE_CONVERSION_TESTS is set to true in deploy-hostpath.sh
85393ef
to
d6470ca
Compare
deploy/util/deploy-hostpath.sh
Outdated
if volume_mode_conversion; then | ||
sed -i -e 's/# end csi-provisioner args/- \"--prevent-volume-mode-conversion=true\"\n # end csi-provisioner args/' $i | ||
fi | ||
# end of container feature flag arguments |
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.
You can remove this comment.
@pohly can we merge this to unblock kubernetes-csi/external-provisioner#832? |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pohly, RaunakShah The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR sets
--prevent-volume-mode-conversion=true
flag in external-provisioner ifVOLUME_MODE_CONVERSION_TESTS
is set.VOLUME_MODE_CONVERSION_TESTS
defaults to false; a new variable indeploy.sh
can enable that feature while deploying the driver.This will be used in sidecar e2e tests in the prow jobs.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: