Skip to content

Added stronghold auto-discovery from kube API#371

Merged
ldmonster merged 1 commit into
mainfrom
stronghold-discovery
May 28, 2026
Merged

Added stronghold auto-discovery from kube API#371
ldmonster merged 1 commit into
mainfrom
stronghold-discovery

Conversation

@trublast
Copy link
Copy Markdown
Contributor

@trublast trublast commented May 27, 2026

If the user has not specified Stronghold access parameters via environment variables or command-line arguments, an attempt will be made to retrieve parameters from the Kubernetes cluster using the current kubconfig context.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an auto-discovery mechanism for Stronghold connection parameters by querying the current Kubernetes cluster context when the user hasn’t provided configuration explicitly, and wires this discovery into the stronghold command execution path.

Changes:

  • Added Kubernetes-based discovery logic to derive Stronghold address, token, and CA cert bytes and apply them via environment variables.
  • Added unit tests for helper functions and the “skip when already configured” path.
  • Updated stronghold command routing so all Stronghold command entrypoints run the discovery step before delegating to the Stronghold/Vault CLI.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
internal/stronghold/discovery.go Implements kube API discovery and applies discovered Stronghold env vars before running CLI.
internal/stronghold/discovery_test.go Adds unit tests for discovery helpers and configured-skip behavior.
cmd/commands/stronghold.go Wraps Stronghold command execution to run discovery before vaultcommand.Run.
cmd/commands/stronghold_commands.go Routes generated subcommands through the new Stronghold runner (with discovery).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/strongholddiscovery/discovery.go
Comment thread cmd/commands/stronghold.go
Comment thread internal/strongholddiscovery/discovery.go
Comment thread internal/strongholddiscovery/discovery.go
Comment thread cmd/commands/stronghold_commands.go
Signed-off-by: Maksim Kiselev <maksim.kiselev@flant.com>
@trublast trublast force-pushed the stronghold-discovery branch from 3910871 to 4d89128 Compare May 28, 2026 07:48
@ldmonster ldmonster merged commit cc17c1f into main May 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants