-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
~/.minikube/files as rootfs "layer" #2110
Conversation
Instead of scping these files to just /files, we mimic the directory structure relative to the ~/.minikube/files directory and place the binaries there. This can be useful for development.
To allow users to overwrite some of the files that we download (kubelet, kubeadm, etc.)
Codecov Report
@@ Coverage Diff @@
## master #2110 +/- ##
=======================================
Coverage 28.86% 28.86%
=======================================
Files 81 81
Lines 5307 5307
=======================================
Hits 1532 1532
Misses 3582 3582
Partials 193 193
Continue to review full report at Codecov.
|
if err != nil { | ||
return errors.Wrap(err, "generating relative path") | ||
} | ||
rPath = filepath.Dir(rPath) |
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.
Not sure this will work with Windows as you stated. Should be able to massage the paths though.
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 don't think the tests will cover this, I don't think any integration tests use the .minikube/files dir.
return errors.Wrap(err, "generating relative path") | ||
} | ||
rPath = filepath.Dir(rPath) | ||
vmpath = filepath.Join("/", rPath) |
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.
Yeah I think this one needs to be a path.Join
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.
Well the tricky thing is that I'm using the host path to determine the remote path.
so rPath is always the relative path to your MINIKUBE_HOME.
Essentially it boils down to - how to do you translate a unix path from a partial windows path? I don't think we can just reverse the slashes and call it day.
This PR applies the
~/.minikube/files
directory as a rootfs rather than just scp-ing the files into/files
. The VM path will be calculated relatively to the~/.minikube/files
folder.Some examples when
MINIKUBE_HOME=~/.minikube
A file at
~/.minikube/files/var/log/testing
will show up in the VM at/var/log/testing
.On the surface this doesn't seem to useful, but you can use it to symlink binaries and utilities:
ln -s ~/go/src/k8s.io/kubernetes/_output/bin/kubelet ~/.minikube/files/usr/bin/kubelet
will let you use a custom kubelet in your minikube cluster.I don't think this will work on windows, since that would equate to translating a windows path to a linux path, which should probably not work. If the test fails, I'll figure out how best to handle that.