controller

package
v0.0.0-...-a53ccdd Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CONTROLLER_TYPE_SIGRUN = "sigrun"
	GUID_TO_REPO_INFO      = "guid_to_repo_info"
	IMAGE_TO_GUIDS         = "image_to_guids"
)
View Source
const (
	SIGRUN_CONTROLLER_CONFIG    = "sigrun-controller-config"
	SIGRUN_CONTROLLER_NAMESPACE = "default"
)

Variables

This section is empty.

Functions

func CertificateToPem

func CertificateToPem(certificateDER []byte) []byte

CertificateToPem ...

func GenerateCACert

func GenerateCACert(certValidityDuration time.Duration) ([]byte, *rsa.PrivateKey, error)

GenerateCACert creates the self-signed CA cert and private key it will be used to sign the webhook server certificate

func GenerateCertPem

func GenerateCertPem(caCertRaw []byte, caKey *rsa.PrivateKey, certValidityDuration time.Duration) ([]byte, *rsa.PrivateKey, error)

GenerateCertPem takes the results of GenerateCACert and uses it to create the PEM-encoded public certificate and private key, respectively

func GetContainersFromResource

func GetContainersFromResource(req *v1beta1.AdmissionReview) ([]corev1.Container, error)

getContainersFromPodOrDeployment returns the containers from a kubernetes object

func New

func New() *sigrunController

func NewError

func NewError(message string, err error) error

func ParseSigrunConfigMap

func ParseSigrunConfigMap(configMap *corev1.ConfigMap) (map[string]*RepoInfo, map[string][]string, error)

func PrivateKeyToPem

func PrivateKeyToPem(rsaKey *rsa.PrivateKey) []byte

PrivateKeyToPem Creates PEM block from private key object

func ValidateContainers

func ValidateContainers(configMap *v1.ConfigMap, containers []v1.Container) error

Types

type ConfigMapCache

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

func NewConfigMapCache

func NewConfigMapCache(client *kubernetes.Clientset) *ConfigMapCache

TODO ideally should invalidate cache when config map is updated instead of every 5 seconds, well something is better than nothing

func (*ConfigMapCache) Get

func (c *ConfigMapCache) Get() (*corev1.ConfigMap, error)

type ContainerValidationError

type ContainerValidationError error

type Error

type Error struct {
	Message string
	Child   error
}

func (*Error) Error

func (e *Error) Error() string

type RepoInfo

type RepoInfo struct {
	config.VerificationInfo
	Path string
}

Jump to

Keyboard shortcuts

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