-
Notifications
You must be signed in to change notification settings - Fork 669
Add possibility to copy ConfigFile to host #1301
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
Conversation
6ccce63
to
4810b29
Compare
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.
Except for the file permissions this seems to be ready for merging, I think, so maybe remove the Draft status?
3c9a8d4
to
784475e
Compare
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.
Thanks, LGTM.
@AkihiroSuda Please merge if you have no objections!
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 still think "conf" ("config") is a confusing name
Also please consider squashing commits |
I don't have a much better name, for a directory for $KUBECONFIG files. It was supposed to be an internal concept, similar to the "sock" directory Could call it "yaml", based on file type ? Or maybe even "kube", to specialize it.
I can squash them when the new names are finalized, I am deliberately trying to scope it down from the last time... Now it looks like a more generic functionality, but the requirement was only to do a So that the wrapper could do something simple, similar to the tunneled sockets:
|
The use for I admit that personally I find it too long, but I can see the value for users not yet familiar with the concept. I too don't have a better suggestion.
Anything documented in the That said, I thought
No, that doesn't work for me. Do you actually means to create different directories, based on the file extension of the copied file? What about files without an extension?
I think the idea is to generalize the name beyond this specific use case, not to specialize it even further. Note that this is also just the default location for relative host names, so mostly useful for shared templates. For local instances I would probably use absolute host names to point to a convenient location instead. |
"yaml" was extrapolating from "sock" (i.e. based on file suffix) "kube" was based on the default location, $HOME/.kube/config If I understand the code correctly, using relative paths would also work. portForwards:
- guestSocket: "/var/run/docker.sock"
hostSocket: "docker.sock" copyToHost:
- guest: "/etc/kubernetes/admin.conf"
host: "kubeconfig.yaml" It wouldn't help for printing out the location, though (probably opposite) At least not without more variables, for the subdirectories of Something like "client" perhaps, but it wouldn't make sense without "config" Can go with Maybe OK, with the new wrapper. I don't really see the difference, I guess the sockets would be And think it looks rather long and ugly, but now I sort of warmed into the |
ea85856
to
6f66cc2
Compare
But "sock" was not based on file suffix (except they accidentally match). It is based on the fact the the only thing you can forward are sockets. And the name was shortened to
Yeah, I can go with that if @AkihiroSuda feels strongly about not using
No, as explained above, there can only be sockets inside
I agree, but I can see the point of it being more self-explanatory. Alternatively, maybe this could be solved by more extensive explanation in the |
"conf" (config) is confusing because the yaml is also called "config". Same applies to the "sock" though, but there is a compromise because of the limit of the sock path length. |
I removed the global constants, so now it is up to each example to name the local files to whatever suits best... The default.yaml shows the suggested |
Thanks, but the commit does not seem updated |
Seems updated to me. The current state of the PR now requires an absolute path for both the guest and the host filename, and no longer provides a default location. It is not clear to me what you are requesting: should the default location be restored and set to |
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.
Thanks, LGTM but with a single nit
This also opens for choosing a more suitable name for each example, matching the files that are copied. Like |
This is actually a reason why I preferred to have a default location because this now opens the instance directory up to users creating arbitrarily named directories, which could conflict with files or directories Lima wan't to create in the future. This was the reason we specified |
Actually they can copy them anywhere on the host, since we require it to be an absolute path and not just a filename... |
Yes, but users copy from the provided examples, and if our examples create random directories inside the instance directories, then that means that we implicitly endorse doing so. |
Any idea to move this forward? (for v0.16 ?) |
Does this need anything more than the single line comment change you requested above, and that @afbjorklund gave the 👍 for, but hasn't pushed yet? |
Put into functions, so that they can be reused for ConfigFile. Fix typo in comment, and add Instance to avoid future conflict. Signed-off-by: Anders F Björklund <[email protected]>
This makes the configuration into a one-liner (variable/path). The start command can do the "mkdir" and "cat" automatically. Signed-off-by: Anders F Björklund <[email protected]>
6f66cc2
to
e416aba
Compare
Missed to update this, didn't know if the names were settled. Need to update kubectl.lima to use "copied-from-guest", sigh. Hopefully that means that nobody has to use the file path. |
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.
Thanks, LGTM
Issue #1300