k8s

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdmissionRegistrationVersion

type AdmissionRegistrationVersion string

type K8s

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

func New

func New(cs kubernetes.Interface, aggregatorCS clientset.Interface, apiextensionsCS apiextensions.Interface) (*K8s, error)

func (*K8s) GetCaFromSecret

func (k8s *K8s) GetCaFromSecret(secretName string, namespace string, caName string) ([]byte, error)

GetCaFromSecret will check for the presence of a secret. If it exists, will return the content of the "ca" from the secret, otherwise will return nil.

func (*K8s) PatchCustomResourceDefinitions

func (k8s *K8s) PatchCustomResourceDefinitions(
	ctx context.Context,
	crds, crdAPIGroup string,
	ca []byte,
) error

func (*K8s) PatchWebhookConfigurations

func (k8s *K8s) PatchWebhookConfigurations(
	ctx context.Context,
	configurationNames string,
	ca []byte,
	failurePolicy string,
	patchMutating bool,
	patchValidating bool,
	version AdmissionRegistrationVersion,
) error

PatchWebhookConfigurations will patch validatingWebhook and mutatingWebhook clientConfig configurations with the provided ca data. If failurePolicy is provided, patch all webhooks with this value.

func (*K8s) SaveCertsToSecret

func (k8s *K8s) SaveCertsToSecret(ctx context.Context, secretName, namespace, caName, certName, keyName string, ca, cert, key []byte) error

SaveCertsToSecret saves the provided ca, cert and key into a secret in the specified namespace.

Jump to

Keyboard shortcuts

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