configurator

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaximumRetries = 20
	AgentName      = "configurator"
)

Variables

This section is empty.

Functions

func ClientConfig added in v0.10.1

func ClientConfig(kubeConfig string, context string) (clientcmd.ClientConfig, *rest.Config, error)

func IsSecretNotPopulatedError

func IsSecretNotPopulatedError(err error) bool

func NewKubeClientFromKubeConfig added in v0.10.0

func NewKubeClientFromKubeConfig(kubeConfigFile, context string) (kubernetes.Interface, error)

func NewShipperClientFromKubeConfig added in v0.10.0

func NewShipperClientFromKubeConfig(kubeConfigFile, context string) (shipperclientset.Interface, error)

Types

type Cluster

type Cluster struct {
	KubeClient         kubernetes.Interface
	ShipperClient      shipperclientset.Interface
	ApiExtensionClient apiextensionclientset.Interface
	Host               string
}

func NewClusterConfigurator

func NewClusterConfigurator(restConfig *rest.Config) (*Cluster, error)

func NewClusterConfiguratorFromKubeConfig added in v0.10.0

func NewClusterConfiguratorFromKubeConfig(kubeConfigFile, context string) (*Cluster, error)

func (*Cluster) ApproveShipperCSR added in v0.3.0

func (c *Cluster) ApproveShipperCSR() error

func (*Cluster) CopySecret

func (c *Cluster) CopySecret(cluster *shipper.Cluster, newNamespace string, secret *corev1.Secret) error

func (*Cluster) CreateCertificateSigningRequest added in v0.3.0

func (c *Cluster) CreateCertificateSigningRequest(csr []byte) error

func (*Cluster) CreateClusterRole

func (c *Cluster) CreateClusterRole(domain, name string) error

func (*Cluster) CreateClusterRoleBinding

func (c *Cluster) CreateClusterRoleBinding(domain, clusterRoleBindingName, clusterRoleName, subjectName, subjectNamespace string) error

func (*Cluster) CreateNamespace

func (c *Cluster) CreateNamespace(namespace string) error

func (*Cluster) CreateOrUpdateCRD

func (c *Cluster) CreateOrUpdateCRD(crd *apiextensionv1beta1.CustomResourceDefinition) error

func (*Cluster) CreateOrUpdateCluster added in v0.10.0

func (c *Cluster) CreateOrUpdateCluster(cluster *shipper.Cluster) error

func (*Cluster) CreateOrUpdateValidatingWebhookConfiguration added in v0.7.0

func (c *Cluster) CreateOrUpdateValidatingWebhookConfiguration(caBundle []byte, namespace string, setToIgnore bool) error

func (*Cluster) CreateOrUpdateValidatingWebhookService added in v0.7.0

func (c *Cluster) CreateOrUpdateValidatingWebhookService(namespace string) error

func (*Cluster) CreateServiceAccount

func (c *Cluster) CreateServiceAccount(domain, namespace string, name string) error

func (*Cluster) CreateValidatingWebhookSecret added in v0.3.0

func (c *Cluster) CreateValidatingWebhookSecret(privateKey, certificate []byte, namespace string) error

func (*Cluster) FetchCertificateFromCSR added in v0.3.0

func (c *Cluster) FetchCertificateFromCSR() ([]byte, error)

FetchCertificateFromCSR continually fetches the Shipper CSR until it is populated with a certificate and then returns the PEM-encoded certificate from the Status. This is a blocking function.

Note that the returned certificate is already PEM-encoded.

func (*Cluster) FetchCluster

func (c *Cluster) FetchCluster(clusterName string) (*shipper.Cluster, error)

func (*Cluster) FetchKubernetesCABundle added in v0.3.0

func (c *Cluster) FetchKubernetesCABundle() ([]byte, error)

func (*Cluster) FetchSecretForServiceAccount

func (c *Cluster) FetchSecretForServiceAccount(name, namespace string) (*corev1.Secret, error)

FetchSecretForServiceAccount polls the server 10 times with a 1 second delay between each. If there is still no secret, it returns a SecretNotPopulated error.

func (*Cluster) ShouldCopySecret

func (c *Cluster) ShouldCopySecret(name, namespace string) (bool, error)

func (*Cluster) UpdateValidatingWebhookConfigurationFailurePolicyToFail added in v0.10.0

func (c *Cluster) UpdateValidatingWebhookConfigurationFailurePolicyToFail() error

func (*Cluster) ValidatingWebhookSecretExists added in v0.3.0

func (c *Cluster) ValidatingWebhookSecretExists(namespace string) (bool, error)

type SecretNotPopulatedError

type SecretNotPopulatedError struct {
	ServiceAccount *corev1.ServiceAccount
}

func NewSecretNotPopulatedError

func NewSecretNotPopulatedError(serviceAccount *corev1.ServiceAccount) *SecretNotPopulatedError

func (SecretNotPopulatedError) Error

func (s SecretNotPopulatedError) Error() string

Jump to

Keyboard shortcuts

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