kubeconfig

package
v0.0.0-...-950e6cb Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeX509CertificateBytes

func DecodeX509CertificateBytes(certBytes []byte) (*x509.Certificate, error)

DecodeX509CertificateBytes will decode a PEM encoded x509 Certificate.

func DecodeX509CertificateChainBytes

func DecodeX509CertificateChainBytes(certBytes []byte) ([]*x509.Certificate, error)

DecodeX509CertificateChainBytes will decode a PEM encoded x509 Certificate chain.

func GetKubernetesHost

func GetKubernetesHost(config *rest.Config) string

func GetRandomString

func GetRandomString(n int) string

func SecretName

func SecretName(name string) string

Types

type CertConfig

type CertConfig struct {
	*DefaultConfig
	// contains filtered or unexported fields
}

func (*CertConfig) Apply

func (c *CertConfig) Apply(config *rest.Config, _ client.Client) (*api.Config, error)

type CsrConfig

type CsrConfig struct {
	*DefaultConfig
	// contains filtered or unexported fields
}

func (*CsrConfig) Apply

func (csr *CsrConfig) Apply(config *rest.Config, client client.Client) (*api.Config, error)

type DefaultConfig

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

func NewConfig

func NewConfig(user string, clusterName string, expirationSeconds int32) *DefaultConfig

func (*DefaultConfig) WithCertConfig

func (d *DefaultConfig) WithCertConfig(caKeyFile string, groups []string, dnsNames []string, ipAddrs []net.IP) Interface

func (*DefaultConfig) WithCsrConfig

func (d *DefaultConfig) WithCsrConfig(groups []string, dnsNames []string, ipAddrs []net.IP, csr *csrv1.CertificateSigningRequest) Interface

func (*DefaultConfig) WithServiceAccountConfig

func (d *DefaultConfig) WithServiceAccountConfig(namespace string, sa *v1.ServiceAccount) Interface

func (*DefaultConfig) WithWebhookConfigConfig

func (d *DefaultConfig) WithWebhookConfigConfig(webhookURL string) Interface

type Interface

type Interface interface {
	Apply(config *rest.Config, client client.Client) (*api.Config, error)
}

type ServiceAccountConfig

type ServiceAccountConfig struct {
	*DefaultConfig
	// contains filtered or unexported fields
}

func (*ServiceAccountConfig) Apply

func (sac *ServiceAccountConfig) Apply(config *rest.Config, client client.Client) (*api.Config, error)

type WebhookConfig

type WebhookConfig struct {
	*DefaultConfig
	// contains filtered or unexported fields
}

func (*WebhookConfig) Apply

func (c *WebhookConfig) Apply(_ *rest.Config, _ client.Client) (*api.Config, error)

Jump to

Keyboard shortcuts

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