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

Provide option to enable volume mode conversion flag to HostPath driver deployment script #379

Merged
merged 2 commits into from
Jan 2, 2023

Conversation

RaunakShah
Copy link
Contributor

@RaunakShah RaunakShah commented Nov 22, 2022

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 if VOLUME_MODE_CONVERSION_TESTS is set. VOLUME_MODE_CONVERSION_TESTS defaults to false; a new variable in deploy.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?:

Provide option to enable volume mode conversion flag to HostPath driver deployment script

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 22, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 22, 2022
@@ -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}"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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!

@RaunakShah RaunakShah changed the title [WIP] Add volume mode conversion flag to HostPath driver Add volume mode conversion flag to HostPath driver Nov 28, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 28, 2022
…t-volume-mode-conversion

flag if VOLUME_MODE_CONVERSION_TESTS is set to true in deploy-hostpath.sh
@RaunakShah RaunakShah changed the title Add volume mode conversion flag to HostPath driver Provide option to enable volume mode conversion flag to HostPath driver deployment script Nov 29, 2022
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
Copy link
Contributor

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.

@RaunakShah RaunakShah changed the title Provide option to enable volume mode conversion flag to HostPath driver deployment script [WIP] Provide option to enable volume mode conversion flag to HostPath driver deployment script Dec 8, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 8, 2022
@RaunakShah RaunakShah changed the title [WIP] Provide option to enable volume mode conversion flag to HostPath driver deployment script Provide option to enable volume mode conversion flag to HostPath driver deployment script Dec 13, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 13, 2022
@RaunakShah
Copy link
Contributor Author

@pohly can we merge this to unblock kubernetes-csi/external-provisioner#832?

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 2, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 2, 2023
@k8s-ci-robot k8s-ci-robot merged commit e1d4596 into kubernetes-csi:master Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants