physicalmachine

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChaosdPkiName = "chaosd"
	// CertificateBlockType is a possible value for pem.Block.Type.
	CertificateBlockType = "CERTIFICATE"
	// CertificateValidity defines the validity for all the signed certificates generated by kubeadm
	CertificateValidity = time.Hour * 24 * 1825
)

Variables

This section is empty.

Functions

func CreatePhysicalMachine

func CreatePhysicalMachine(ctx context.Context, c client.Client,
	namespace, name, address string, labels map[string]string) error

func EncodeCertPEM

func EncodeCertPEM(cert *x509.Certificate) []byte

EncodeCertPEM returns PEM-endcoded certificate data

func GetChaosdCAFileFromCluster

func GetChaosdCAFileFromCluster(ctx context.Context, namespace string, c client.Client) (caCert *x509.Certificate, caKey crypto.Signer, err error)

func GetChaosdCAFileFromFile

func GetChaosdCAFileFromFile(caCertFile, caKeyFile string) (*x509.Certificate, crypto.Signer, error)

func NewCertAndKey

func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, crypto.Signer, error)

NewCertAndKey creates new certificate and key by passing the certificate authority certificate and key

func NewPhysicalMachineCreateCmd

func NewPhysicalMachineCreateCmd() (*cobra.Command, error)

func NewPhysicalMachineGenerateCmd

func NewPhysicalMachineGenerateCmd() (*cobra.Command, error)

func NewPhysicalMachineInitCmd

func NewPhysicalMachineInitCmd() (*cobra.Command, error)

func NewPrivateKey

func NewPrivateKey(keyType x509.PublicKeyAlgorithm) (crypto.Signer, error)

func NewSignedCert

func NewSignedCert(key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer, isCA bool) (*x509.Certificate, error)

NewSignedCert creates a signed certificate using the given CA certificate and key

func ParseCert

func ParseCert(data []byte) (*x509.Certificate, error)

func ParseCertAndKey

func ParseCertAndKey(certData, keyData []byte) (*x509.Certificate, crypto.Signer, error)

func ParsePrivateKey

func ParsePrivateKey(data []byte) (crypto.Signer, error)

func WriteCert

func WriteCert(pkiPath, name string, cert *x509.Certificate) error

WriteCert stores the given certificate at the given location

func WriteCertAndKey

func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key crypto.Signer) error

WriteCertAndKey stores certificate and key at the specified location

func WriteKey

func WriteKey(pkiPath, name string, key crypto.Signer) error

WriteKey stores the given key at the given location

Types

type PhysicalMachineCreateOptions

type PhysicalMachineCreateOptions struct {
	// contains filtered or unexported fields
}

func (*PhysicalMachineCreateOptions) Run

func (o *PhysicalMachineCreateOptions) Run(args []string) error

func (*PhysicalMachineCreateOptions) Validate

func (o *PhysicalMachineCreateOptions) Validate() error

type PhysicalMachineGenerateOptions

type PhysicalMachineGenerateOptions struct {
	// contains filtered or unexported fields
}

func (*PhysicalMachineGenerateOptions) Run

func (*PhysicalMachineGenerateOptions) Validate

func (o *PhysicalMachineGenerateOptions) Validate() error

type PhysicalMachineInitOptions

type PhysicalMachineInitOptions struct {
	// contains filtered or unexported fields
}

func (*PhysicalMachineInitOptions) Run

func (o *PhysicalMachineInitOptions) Run(args []string) error

func (*PhysicalMachineInitOptions) Validate

func (o *PhysicalMachineInitOptions) Validate() error

type SshTunnel

type SshTunnel struct {
	// contains filtered or unexported fields
}

func NewSshTunnel

func NewSshTunnel(ip, port string, user, privateKeyFile string) (*SshTunnel, error)

func (*SshTunnel) Close

func (s *SshTunnel) Close() error

func (*SshTunnel) Open

func (s *SshTunnel) Open() error

func (*SshTunnel) SFTP

func (s *SshTunnel) SFTP(filename string, data []byte) error

Jump to

Keyboard shortcuts

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