Skip to content

Commit c558560

Browse files
kvapsclaude
andauthored
feat(rotate-ca): add auto-discovery and post-processing (#104)
* feat(rotate-ca): add auto-discovery and post-processing - Auto-discover control plane and worker nodes from Kubernetes API - Auto-set --control-plane-nodes and --worker-nodes flags - Auto-set --output to project talosconfig path - Auto-set --k8s-endpoint from --endpoints flag - Post-processing after rotation: - Update secrets.yaml with new CA from cluster - Update talosconfig.encrypted if exists - Update kubeconfig via talm kubeconfig - Validate only one endpoint/node is provided - Use endpoint as target node for COSI requests - Disable --with-docs and --with-examples by default - Update help text and examples Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com> * fix(commands): address review comments - Check total endpoints + nodes count in rotate-ca validation - Propagate decryption errors in init.go instead of ignoring them - Check flag existence with Lookup() before calling Set() - Handle all Set() errors properly Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com> --------- Signed-off-by: Andrei Kvapil <kvapss@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6111a21 commit c558560

3 files changed

Lines changed: 350 additions & 17 deletions

File tree

pkg/commands/init.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,9 @@ var initCmd = &cobra.Command{
324324

325325
// If encrypted file exists, decrypt it (don't require key - will generate if needed)
326326
if encryptedTalosconfigFileExists && !talosconfigFileExists {
327-
// If decryption fails (e.g., no key), continue to generate
328-
_, _ = handleTalosconfigEncryption(false)
327+
if _, err := handleTalosconfigEncryption(false); err != nil {
328+
return err
329+
}
329330
talosconfigFileExists = fileExists(talosconfigFile)
330331
}
331332

0 commit comments

Comments
 (0)