ssh

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterNodeSshKeys

type ClusterNodeSshKeys struct {
	ClusterContext *clustercontext.ClusterContext
	Client         runtimeclient.Client
	PublicKey      []byte // in the format "ssh-rsa ...", base64 encoded
	PrivateKey     []byte // in PEM format
}

ClusterNodeSshKeys is a struct containing nodes ssh keys.

func NewClusterNodeSshKeys

func NewClusterNodeSshKeys(clusterContext *clustercontext.ClusterContext, client runtimeclient.Client) *ClusterNodeSshKeys

NewClusterNodeSshKeys creates a new struct for cluster nodes ssh keys

func (*ClusterNodeSshKeys) FetchPersistedKeysFromSecret

func (c *ClusterNodeSshKeys) FetchPersistedKeysFromSecret() error

FetchPersistedKeysFromSecret fetches public and private keys from secret note, the public key is base64 encoded "ssh-rsa ..." string note, the private key is in PEM format

func (*ClusterNodeSshKeys) GenerateNewKeys

func (c *ClusterNodeSshKeys) GenerateNewKeys() error

GenerateNewKeys generates a new pair of ssh keys

func (*ClusterNodeSshKeys) GetKeysDataSecret

func (c *ClusterNodeSshKeys) GetKeysDataSecret() (*corev1.Secret, error)

GetKeysDataSecret retrieves a pointer to the ssh keys secret.

func (*ClusterNodeSshKeys) IsPersistedToSecret

func (c *ClusterNodeSshKeys) IsPersistedToSecret() bool

IsPersistedToSecret checks if a secret with ssh keys already exists, and contains key values

func (*ClusterNodeSshKeys) PersistKeysToSecret

func (c *ClusterNodeSshKeys) PersistKeysToSecret() (*corev1.Secret, error)

PersistKeysToSecret persists public and private keys to secret

type VMCommandExecutor

type VMCommandExecutor interface {
	ExecuteCommand(string) (string, error)
}

func NewVMCommandExecutor

func NewVMCommandExecutor(address string, keys *ClusterNodeSshKeys) VMCommandExecutor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL