...

Package physicalmachine

import "github.com/chaos-mesh/chaos-mesh/pkg/chaosctl/physicalmachine"
Overview
Index

Overview ▾

Index ▾

Constants
func CreatePhysicalMachine(ctx context.Context, c client.Client, namespace, name, address string, labels map[string]string) error
func EncodeCertPEM(cert *x509.Certificate) []byte
func GetChaosdCAFileFromCluster(ctx context.Context, namespace string, c client.Client) (caCert *x509.Certificate, caKey crypto.Signer, err error)
func GetChaosdCAFileFromFile(caCertFile, caKeyFile string) (*x509.Certificate, crypto.Signer, error)
func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, crypto.Signer, error)
func NewPhysicalMachineCreateCmd() (*cobra.Command, error)
func NewPhysicalMachineGenerateCmd() (*cobra.Command, error)
func NewPhysicalMachineInitCmd() (*cobra.Command, error)
func NewPrivateKey(keyType x509.PublicKeyAlgorithm) (crypto.Signer, error)
func NewSignedCert(key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer, isCA bool) (*x509.Certificate, error)
func ParseCert(data []byte) (*x509.Certificate, error)
func ParseCertAndKey(certData, keyData []byte) (*x509.Certificate, crypto.Signer, error)
func ParsePrivateKey(data []byte) (crypto.Signer, error)
func WriteCert(pkiPath, name string, cert *x509.Certificate) error
func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key crypto.Signer) error
func WriteKey(pkiPath, name string, key crypto.Signer) error
type PhysicalMachineCreateOptions
    func (o *PhysicalMachineCreateOptions) Run(args []string) error
    func (o *PhysicalMachineCreateOptions) Validate() error
type PhysicalMachineGenerateOptions
    func (o *PhysicalMachineGenerateOptions) Run() error
    func (o *PhysicalMachineGenerateOptions) Validate() error
type PhysicalMachineInitOptions
    func (o *PhysicalMachineInitOptions) Run(args []string) error
    func (o *PhysicalMachineInitOptions) Validate() error
type SshTunnel
    func NewSshTunnel(ip, port string, user, privateKeyFile string) (*SshTunnel, error)
    func (s *SshTunnel) Close() error
    func (s *SshTunnel) Open() error
    func (s *SshTunnel) SFTP(filename string, data []byte) error

Package files

create.go generate.go init.go pki.go ssh.go

Constants

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
)

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

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 (o *PhysicalMachineGenerateOptions) Run() error

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