Skip to content

fix(talosctl): pass --k8s-endpoint flag to rotate-ca kubernetes rotation - #12644

Closed
kvaps wants to merge 1 commit into
siderolabs:mainfrom
cozystack:fix/rotate-ca-k8s-endpoint
Closed

kvaps wants to merge 1 commit into
siderolabs:mainfrom
cozystack:fix/rotate-ca-k8s-endpoint

Conversation

@kvaps

@kvaps kvaps commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

What? (description)

Pass the --k8s-endpoint flag value to the Kubernetes client during CA rotation.

The flag was defined in the CLI but never actually used - the value was stored in rotateCACmdFlags.forceEndpoint but not passed to kubernetes.Options, so the Kubernetes client always used the default endpoint from kubeconfig.

Why? (reasoning)

When rotating Kubernetes CA on a cluster behind NAT or with a virtual IP that is not directly accessible, users need to specify an alternative endpoint. Without this fix, the --k8s-endpoint flag has no effect and the rotation fails trying to connect to the unreachable default endpoint.

Acceptance

Please use the following checklist:

  • you linked an issue (if applicable)
  • you included tests (if applicable)
  • you ran conformance (make conformance)
  • you formatted your code (make fmt)
  • you linted your code (make lint)
  • you generated documentation (make docs)
  • you ran unit-tests (make unit-tests)

The --k8s-endpoint flag was defined but never used in the rotate-ca
command. This fix passes the flag value through to the Kubernetes
client, allowing users to override the default Kubernetes API endpoint
during CA rotation.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
@github-project-automation github-project-automation Bot moved this to To Do in Planning Jan 22, 2026
@kvaps
kvaps marked this pull request as ready for review January 23, 2026 09:34
@talos-bot talos-bot moved this from To Do to In Review in Planning Jan 23, 2026
@smira smira self-assigned this Jan 26, 2026
@smira

smira commented Jan 26, 2026

Copy link
Copy Markdown
Member

Forking this PR as I can't push back to org branches.

@smira smira closed this Jan 26, 2026
@github-project-automation github-project-automation Bot moved this from In Review to Done in Planning Jan 26, 2026
lexfrei added a commit to cozystack/talm that referenced this pull request Apr 10, 2026
Remove reference to siderolabs/talos#12644 (--k8s-endpoint), which was
closed in favor of #12669 and merged upstream. The remaining driver for
the fork is #12652 (--skip-verify), which upstream declined on security
grounds, so the fork is required for as long as we need that flag.

Signed-off-by: Aleksei Sviridkin <[email protected]>
lexfrei added a commit to cozystack/talm that referenced this pull request Apr 10, 2026
Routine dependency bump pass with code modernization.

Go toolchain:
- go: 1.25.6 -> 1.26.2

Direct Go dependencies:
- k8s.io/{api,apimachinery,client-go}: v0.35.0 -> v0.35.3
- github.com/cosi-project/runtime: v1.13.0 -> v1.14.1
- github.com/siderolabs/crypto: v0.6.4 -> v0.6.5
- github.com/siderolabs/talos/pkg/machinery: v1.13.0-alpha.0 -> v1.13.0-beta.1
- github.com/siderolabs/talos: v1.12.2 -> v1.12.6
- github.com/spf13/cobra: v1.10.1 -> v1.10.2
- google.golang.org/grpc: v1.77.0 -> v1.80.0 (closes CVE-2026-33186)
- filippo.io/age: v1.2.1 -> v1.3.1
- github.com/BurntSushi/toml: v1.5.0 -> v1.6.0
- helm.sh/helm/v3: v3.19.5 -> v3.20.2

k8s.io indirect lockstep to v0.35.3:
- apiextensions-apiserver, apiserver, cli-runtime, component-base,
  component-helpers, kms, kubectl

Indirect security fixes:
- github.com/docker/cli: v29.1.3 -> v29.4.0 (closes CVE-2025-15558)
- github.com/cloudflare/circl: v1.6.1 -> v1.6.3 (closes CVE-2026-1229)

Round-2 bumps unblocked by Go 1.26:
- github.com/siderolabs/go-kubeconfig: v0.1.1 -> v0.1.2
- github.com/siderolabs/go-talos-support: v0.1.4 -> v0.2.0

327 additional indirect dependency updates applied across two passes via
targeted go get (each change validated with go build).

GitHub Actions:
- actions/checkout: v4 -> v6
- actions/setup-go: v5 -> v6
- goreleaser/goreleaser-action: v6 -> v7

Renovate config:
- Add .github/renovate.json with config:recommended preset and a custom
  regex manager surfacing helm.sh/helm v3 -> v4 upgrade proposals. The
  config is inert until the Renovate GitHub App is installed.

Fork replace rationale:
- Update go.mod comment to reference only siderolabs/talos#12652
  (--skip-verify, declined upstream). The previous siderolabs/talos#12644
  (--k8s-endpoint) reference is stale since #12669 was merged upstream.

Code modernization:
- gopls modernize and go fix across the codebase: interface{} -> any,
  maps.Copy, slices.Contains, gofmt cleanup. No behavior changes.

Bug fix:
- Guard initConfig() against missing os.Args[1] to prevent panic on
  plain `talm` invocation with no arguments.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
lexfrei added a commit to cozystack/talm that referenced this pull request Apr 14, 2026
Routine dependency bump pass with code modernization.

Go toolchain:
- go: 1.25.6 -> 1.26.2

Direct Go dependencies:
- k8s.io/{api,apimachinery,client-go}: v0.35.0 -> v0.35.3
- github.com/cosi-project/runtime: v1.13.0 -> v1.14.1
- github.com/siderolabs/crypto: v0.6.4 -> v0.6.5
- github.com/siderolabs/talos/pkg/machinery: v1.13.0-alpha.0 -> v1.13.0-beta.1
- github.com/siderolabs/talos: v1.12.2 -> v1.12.6
- github.com/spf13/cobra: v1.10.1 -> v1.10.2
- google.golang.org/grpc: v1.77.0 -> v1.80.0 (closes CVE-2026-33186)
- filippo.io/age: v1.2.1 -> v1.3.1
- github.com/BurntSushi/toml: v1.5.0 -> v1.6.0
- helm.sh/helm/v3: v3.19.5 -> v3.20.2

k8s.io indirect lockstep to v0.35.3:
- apiextensions-apiserver, apiserver, cli-runtime, component-base,
  component-helpers, kms, kubectl

Indirect security fixes:
- github.com/docker/cli: v29.1.3 -> v29.4.0 (closes CVE-2025-15558)
- github.com/cloudflare/circl: v1.6.1 -> v1.6.3 (closes CVE-2026-1229)

Round-2 bumps unblocked by Go 1.26:
- github.com/siderolabs/go-kubeconfig: v0.1.1 -> v0.1.2
- github.com/siderolabs/go-talos-support: v0.1.4 -> v0.2.0

327 additional indirect dependency updates applied across two passes via
targeted go get (each change validated with go build).

GitHub Actions:
- actions/checkout: v4 -> v6
- actions/setup-go: v5 -> v6
- goreleaser/goreleaser-action: v6 -> v7

Renovate config:
- Add .github/renovate.json with config:recommended preset and a custom
  regex manager surfacing helm.sh/helm v3 -> v4 upgrade proposals. The
  config is inert until the Renovate GitHub App is installed.

Fork replace rationale:
- Update go.mod comment to reference only siderolabs/talos#12652
  (--skip-verify, declined upstream). The previous siderolabs/talos#12644
  (--k8s-endpoint) reference is stale since #12669 was merged upstream.

Code modernization:
- gopls modernize and go fix across the codebase: interface{} -> any,
  maps.Copy, slices.Contains, gofmt cleanup. No behavior changes.

Bug fix:
- Guard initConfig() against missing os.Args[1] to prevent panic on
  plain `talm` invocation with no arguments.

Assisted-By: Claude <[email protected]>

Signed-off-by: Aleksei Sviridkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants