common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SecretInitVolumeName = "secret-init"

Variables

This section is empty.

Functions

func GetBaseSecurityContext

func GetBaseSecurityContext(podSecurityContext *corev1.PodSecurityContext, webhookConfig appCommon.Config) *corev1.SecurityContext

func GetDataFromConfigmap

func GetDataFromConfigmap(ctx context.Context, k8sClient kubernetes.Interface, cmName string, ns string) (map[string]string, error)

func GetDataFromSecret

func GetDataFromSecret(ctx context.Context, k8sClient kubernetes.Interface, secretName string, ns string) (map[string][]byte, error)

func GetServiceAccountMount

func GetServiceAccountMount(containers []corev1.Container, serviceAccountTokenVolumeName string) (serviceAccountMount corev1.VolumeMount)

func HasTLSVolume

func HasTLSVolume(volumes []corev1.Volume, tlsVolumeName string) bool

If the original Pod contained a Volume "{providerName}-tls", for example Vault instances provisioned by the Operator we need to handle that edge case and choose another name for the vault-tls volume for accessing Vault with TLS.

func IsLogLevelSet

func IsLogLevelSet(envVars []corev1.EnvVar) bool

isLogLevelSet checks if the SECRET_INIT_LOG_LEVEL environment variable has already been set in the container, so it doesn't get overridden.

func IsPodAlreadyMutated

func IsPodAlreadyMutated(pod *corev1.Pod) bool

func MutateConfigMapBinaryData

func MutateConfigMapBinaryData(configMap *corev1.ConfigMap, mapData map[string]string) error

Types

type DockerAuthConfig

type DockerAuthConfig struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Auth     string `json:"auth,omitempty"`

	// Email is an optional value associated with the username.
	// This field is deprecated and will be removed in a later
	// version of docker.
	Email string `json:"email,omitempty"`

	ServerAddress string `json:"serveraddress,omitempty"`

	// IdentityToken is used to authenticate the user and get
	// an access token for the registry.
	IdentityToken string `json:"identitytoken,omitempty"`

	// RegistryToken is a bearer token to be sent to a registry
	RegistryToken string `json:"registrytoken,omitempty"`
}

DockerAuthConfig contains authorization information for connecting to a Registry

type DockerCredentials

type DockerCredentials struct {
	Auths map[string]DockerAuthConfig `json:"auths"`
}

type Iterator

type Iterator <-chan element

func MapIterator

func MapIterator(m map[string]interface{}) Iterator

func SliceIterator

func SliceIterator(s []interface{}) Iterator

Jump to

Keyboard shortcuts

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