Documentation ¶
Index ¶
- func NewK8SClient() (kubernetes.Interface, error)
- type ASMConfig
- type Mutator
- func (mw *Mutator) ConfigMapHasSecret(cmName string, ns string, optional *bool) (hasSecret bool, err error)
- func (m *Mutator) ContainerHasSecrets(container *corev1.Container, ns string) (hasSecrets bool, err error)
- func (m *Mutator) CreateInitContainer(config ASMConfig) []corev1.Container
- func (m *Mutator) CreateVolume(config ASMConfig) []corev1.Volume
- func (m *Mutator) EnvFromHasSecret(envFrom *[]corev1.EnvFromSource, ns string) (hasSecrets bool, err error)
- func (m *Mutator) ExtractArgsFromImageConfig(ctx context.Context, container *corev1.Container, podSpec *corev1.PodSpec, ...) (args []string, err error)
- func (m *Mutator) MutateContainers(ctx context.Context, containers []corev1.Container, pod *corev1.Pod, ...) (out []corev1.Container, shouldMutate bool, err error)
- func (m *Mutator) MutatePod(ctx context.Context, pod *corev1.Pod, config ASMConfig) (res *kwhmutating.MutatorResult, err error)
- func (m *Mutator) MutateSingleContainer(ctx context.Context, container *corev1.Container, podSpec *corev1.PodSpec, ...) (new *corev1.Container, err error)
- func (m *Mutator) ParseConfig(obj metav1.Object) ASMConfig
- func (mw *Mutator) SecretRefHasSecret(secretName string, ns string, optional *bool) (hasSecret bool, err error)
- func (m *Mutator) SecretsMutator(ctx context.Context, _ *kwhmodel.AdmissionReview, obj metav1.Object) (*kwhmutating.MutatorResult, error)
- func (m *Mutator) SourceHasSecret(env *corev1.EnvVar, ns string) (hasSecret bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewK8SClient ¶
func NewK8SClient() (kubernetes.Interface, error)
Types ¶
type Mutator ¶
type Mutator struct { K8sClient kubernetes.Interface Namespace string Registry registry.ImageRegistry }
func CreateClient ¶
func (*Mutator) ConfigMapHasSecret ¶
func (*Mutator) ContainerHasSecrets ¶
func (*Mutator) CreateInitContainer ¶
CreateInitContainer injects an initContainer that copies the asm-env binary to a shared mounted volume
func (*Mutator) CreateVolume ¶
CreateVolume creates the shared volume that receives asm-env binary
func (*Mutator) EnvFromHasSecret ¶
func (*Mutator) ExtractArgsFromImageConfig ¶
func (*Mutator) MutateContainers ¶
func (*Mutator) MutatePod ¶
func (m *Mutator) MutatePod(ctx context.Context, pod *corev1.Pod, config ASMConfig) (res *kwhmutating.MutatorResult, err error)
MutatePod loops over every initContainer and container to mutate them if necessary
func (*Mutator) MutateSingleContainer ¶
func (*Mutator) SecretRefHasSecret ¶
func (*Mutator) SecretsMutator ¶
func (m *Mutator) SecretsMutator(ctx context.Context, _ *kwhmodel.AdmissionReview, obj metav1.Object) (*kwhmutating.MutatorResult, error)
SecretsMutator receives the object to mutate and calls the right function according to its type
Click to show internal directories.
Click to hide internal directories.