Documentation
¶
Overview ¶
Package sshconfig manages the SSH client configuration for `vcluster platform connect slurm`. It maintains a dedicated, fully managed drop-in file (~/.ssh/vcluster/config) with one marker-delimited Host block per Slurm instance, and idempotently wires it into the user's main ~/.ssh/config via a single `Include` line. The Include is placed near the top but is careful never to split a leading comment block from the lines it documents (see includeInsertIndex). It never edits any other part of the main config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAlias ¶
DefaultAlias returns the default alias for an instance: <instance>.<project>.slurm.
func NormalizeHost ¶
NormalizeHost strips the scheme and any trailing slash so the marker stays a single clean token.
Types ¶
type Block ¶
type Block struct {
// PlatformHost, Project and Instance form the block's source identity and
// are encoded into the BEGIN/END markers. PlatformHost is also pinned into
// the generated ProxyCommand (--host) so the alias keeps targeting the same
// platform even after the CLI logs into a different one.
PlatformHost string
Project string
Instance string
// Alias is the SSH host alias the user types (`ssh <alias>`).
Alias string
// Executable is the absolute path to the vcluster binary used in the
// ProxyCommand.
Executable string
// Insecure adds --insecure to the generated ProxyCommand so future ssh
// sessions tolerate the platform's self-signed certificate.
Insecure bool
}
Block describes a single managed Host block.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager reads and writes the managed SSH configuration.
func NewWithDir ¶
NewWithDir returns a Manager rooted at an explicit directory. It is intended for tests; generated config text uses absolute paths under dir.
func (*Manager) Add ¶
Add writes or replaces the managed block for b and ensures the main config includes the managed file. It is idempotent: re-running with the same inputs produces no change. An alias already used by a differently-sourced block is a collision and returns an error suggesting --alias.