-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: Added ssh namespace #2240
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Daniil Stepanenko <[email protected]>
Hi @libmonsoon-dev, sorry for the delay in reviewing. For major features like this I prefer if you file an issue first so we can discuss the specifics before you spend time on it. See https://github.com/hairyhenderson/gomplate/blob/main/CONTRIBUTING.md for details. It seems to me that you've added a new SSH sub-namespace inside the From a quick scan at what you've added, it seems most of these should just be functions in the Can you explain in greater detail what you need to accomplish? |
Hello. Everything is fine, there is no rush. I solved my problem by compiling a binary from my own fork with this functionality.
Okay, next time I'll create an issue first. But is it necessary to create one in this case, or can we discuss these changes right here?
Yes, that's right. I wanted to recreate the structure similar to the packages in the standard library (and in golang.org/x/...). There ssh is separated into a subpackage, and in my opinion that makes sense.
Not exactly. I initially read keys in OpenSSH format from the directory where OpenSSH stores them.
The initial problem that I solved with this functionality is the creation of a universal config for cloud init, each cloud has its own specifics, for example, for the current one that I use, you need to run a special script that will install and run the Zabbix agent so that the metrics are displayed in the web interface. But I digress. I would like the template not to contain a specific key, but instead, when generating the config from the template, the current key of the user who started the generation will be used |
We can discuss here - just keep in mind that I may require significant changes for this to be merged if it's merged at all (no guarantees).
gomplate's function namespaces are not really intended to mirror the stdlib. There's only a single level of namespaces currently, and I'm not convinced there's a compelling reason to support additional layers.
The goal is still a bit unclear to me, but it seems to me that you probably don't need to parse the public key at all, but rather to simply Wouldn't something like |
Tested on Linux. I would be grateful if someone could see if it works on Windows, I don’t have that option