-
Notifications
You must be signed in to change notification settings - Fork 554
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
change config dir location #286
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @webern! |
Hi @webern. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/check-cla |
/check-cla |
I signed it |
/check-cla |
I signed it |
/check-cla |
/retest |
Hmmm, OK, I may need some help understanding why the e2e tests are failing. Or maybe a walkthrough of what's actually happening. e.g. does a container with my Go changes get built and used in the test? |
7fc9f51
to
e7cc126
Compare
/retest |
pkg/driver/config_dir_test.go
Outdated
} | ||
} | ||
|
||
// TestInitConfigDirPreferredError asserts that a symlink an error is returned when a symlink cannot be created to the |
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.
asserts that a symlink an error is returned...
Ok, got it, since the controller makes no reference to any config directories, the new function fails like this:
I guess it should be oky to remove the check and just create preferredDir /var/amazon/efs if it doesn't exist? In the node setting we can assume that it will be created by hostpath DirectoryOrCreate, in controller setting we don't care about persisting configs at all. @kbasv since the controller should only briefly mount efs volumes to delete them is it necessary for its config and such to be persistent? I am saying here no, but could you please confirm. |
@wongma7 Controller doesn't require persistent configs |
OK, If I understand correctly, we also need to run in an environment where the mounts that I was expecting are not there. In that case we probably want the contents of |
@webern yes that makes sense to me |
ec2d8df
to
5ccb581
Compare
This has most of my changes. A simplification of the config dir function to account for runtimes where legacy and preferred host paths are not mounted:
I missed a couple of refactor opportunities in the tests and added them in this push:
I rebased and fixed conflicts in main.go:
|
Actually the right solution was to create an empty dir since the configs will be copied into it. |
pkg/driver/config_dir_test.go
Outdated
defer cleanup(t, dir) | ||
|
||
// create legacy dir and a fake pre-existing conf file | ||
// create an empty legacy dir |
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.
nit extra comment here
/lgtm beautiful, thank you Next steps for me:
|
Before this change, the driver failed to work on Bottlerocket because it tries to write files into the host directory /etc/amazon/efs. On Bottlerocket that directory is not writable by the container. We want to move the host mount point to /var/amazon/efs, but we need to support backward compatibility with hosts that may already have configs written to /etc/amazon/efs. To solve this, we mount both host paths and check for the presence of config files at container runtime. If we find files in the old location, we symlink to that location, otherwise we symlink to the new location.
I fixed the incorrect comment. We needed a retest anyway. The 12 failed tests looked like timeouts, which is what I remember failed tests looking like in the past when a retest passed. Unfortunately fixing that comment removed the lgtm flag. |
/lgtm Yes, just checked logs too and this time the containers all became ready so I don't think it has anything to do with this PR. will repro locally tomorrow if happens again |
Is this a bug fix or adding new feature?
Fixes #246
Replaces #247
Fixes bottlerocket-os/bottlerocket#1111
What is this PR about? / Why do we need it?
What testing is done?
I built my changes to a container image, pushed to a private ECR repo, and changed yaml files accordingly to use my changes. Throughout, I used a canary application from these instructions https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html which mounts an EFS volume and logs to it every five seconds.
/etc/amazon/efs
./etc/amazon/efs
was still being used and/var/amazon/efs
was empty./etc/amazon/efs
was empty and `/var/amazon/efs/ was being used./var/amazon/efs
and that mounts were working.