Closed budimanjojo closed 2 years ago
I think the end-goal, which talhelper gensecret / sops -e achieves is to be able to add the generated secrets to the repo in the encrypted form.
So, if talosctl gensecret can achieve this then that's great and talhelper gensecret should just delegate to talosctl. If not, then I wouldn't change a thing and leave talhelper as is since it already achieves the end goal.
Another thing to remember is the current functionality might just need to stick around too unless you are going to do a migration to the talosctl gensecret mechanism
Another thing to remember is the current functionality might just need to stick around too unless you are going to do a migration to the talosctl gensecret mechanism
Yes, the current functionality of talenv.yaml
will always work no matter what, whatever you put inside will still be decrypted and being envsubst
. It's more about separating cert secrets
from env
file. I always feel that the current implementation of --patch-configfile
a bit of ugly because it put so many stuffs into talconfig.yaml
.
So another idea to replace --patch-configfile on the gensecrets command is talhelper genconfig --with-secrets. It silently adds the configfile patches to the user's talconfig.yaml (if they aren't there) and goes from there. Source file is cleaner and the functionality is maintained.
I think this should be good? https://github.com/budimanjojo/talhelper/pull/29
Works as expected - great job!
Following the merged PR in the upstream
talos
: https://github.com/siderolabs/talos/pull/5870. It's really a great idea that I didn't think of at the time I do this. Now I have some ideas about how this should be implemented. Which approach should I go?talhelper gensecret
to output a yaml encoded data liketalosctl gen secret
.talhelper genconfig
will read a file calledtalsecret.yaml
if it exists to generate the manifests. This will preserve the currenttalenv.yaml
and no breaking change. Thetalhelper gensecret --path-configfile
flag will be deleted though.talhelper gensecret
to output a yaml encoded data liketalosctl gen secret
.talhelper gensecret --patch-envfile
will patch thetalenv.yaml
file a new fieldsecretBundle
that contains the mapping of the secret.talhelper genconfig
will generate the manifests with those secrets if it's specified and this shouldn't be a breaking change too. Thetalhelper gensecret --patch-configfile
flag will be deleted too.I will begin working when the
talosctl
version with this PR is released and when I have decided which route to go.