Documentation
¶
Index ¶
- Constants
- func CreatePatch(pod *corev1.Pod, sidecarInject *SidecarInject, annotations map[string]string) ([]byte, error)
- func FindTokenVolumeName(volumes []corev1.Volume) string
- func FindVolumeMount(volumes []corev1.VolumeMount, name string) corev1.VolumeMount
- func GetAnnotationValue(pod corev1.Pod, name *registeredAnnotation, defaultValue string) string
- func GetDeploymentName(name string) (string, error)
- func Load(file string, c interface{})
- func Pod(raw []byte, pod *corev1.Pod) error
- func PotentialNamespace(req *v1.AdmissionRequest, pod *corev1.Pod) string
- func PotentialPodName(metadata *metav1.ObjectMeta) string
- func ToAdmissionResponseError(err error) *v1.AdmissionResponse
- type SidecarConfig
- type SidecarData
- type SidecarInject
- type WebHook
Constants ¶
const (
// VaultAgentConfigPrefix represents a prefix for the config map
VaultAgentConfigPrefix = "vault-agent-config"
)
Variables ¶
This section is empty.
Functions ¶
func CreatePatch ¶
func CreatePatch(pod *corev1.Pod, sidecarInject *SidecarInject, annotations map[string]string) ([]byte, error)
CreatePatch to inject the change
func FindTokenVolumeName ¶
FindTokenVolumeName retrieves the Secret -token types volume
func FindVolumeMount ¶
func FindVolumeMount(volumes []corev1.VolumeMount, name string) corev1.VolumeMount
FindVolumeMount returns the volume mount entry
func GetAnnotationValue ¶
GetAnnotationValue returns the vaule of annotation from a Pod
func GetDeploymentName ¶
GetDeploymentName return the name of a Deployment
func PotentialNamespace ¶
func PotentialNamespace(req *v1.AdmissionRequest, pod *corev1.Pod) string
PotentialNamespace deal with potential namespace name
func PotentialPodName ¶
func PotentialPodName(metadata *metav1.ObjectMeta) string
PotentialPodName deal with potential empty fields, e.g., when the pod is created by a deployment
func ToAdmissionResponseError ¶
func ToAdmissionResponseError(err error) *v1.AdmissionResponse
ToAdmissionResponseError creates a not allowed AdmissionResponse
Types ¶
type SidecarConfig ¶
type SidecarConfig struct { Template string `json:"template"` VaultAgentConfig string `json:"agent.config"` VaultAgentTemplate string `json:"template.ctmpl"` }
SidecarConfig defines the sidecar ConfigMap configuration
type SidecarData ¶
type SidecarData struct { Name string Container corev1.Container TokenVolume string VaultSecret string VaultFileName string VaultRole string VaultInit bool }
SidecarData defines data to be injected in the template
type SidecarInject ¶
type SidecarInject struct { InitContainers []corev1.Container `yaml:"initContainers"` Containers []corev1.Container `yaml:"containers"` Volumes []corev1.Volume `yaml:"volumes"` VolumeMount []corev1.VolumeMount `yaml:"volumeMounts"` }
SidecarInject defines the content to be injected
type WebHook ¶
type WebHook struct { SidecarConfig *SidecarConfig VaultConfig *SidecarInject }
WebHook defines the webhook configuration