Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
asad-awadia committed Aug 16, 2021
1 parent e3547a1 commit 36d4bfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/webhook/image_swapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ func (p *ImageSwapper) Mutate(ctx context.Context, obj metav1.Object) (bool, err

lctx := logger.WithContext(ctx)

p.replaceContainerImages(lctx, ar, pod, pod.Spec.Containers)
p.replaceContainerImages(lctx, ar, pod, pod.Spec.InitContainers)
p.processContainers(lctx, ar, pod, pod.Spec.Containers)
p.processContainers(lctx, ar, pod, pod.Spec.InitContainers)
return false, nil
}

func (p *ImageSwapper) replaceContainerImages(lctx context.Context, ar *v1beta1.AdmissionRequest, pod *corev1.Pod, containers []corev1.Container) {
func (p *ImageSwapper) processContainers(lctx context.Context, ar *v1beta1.AdmissionRequest, pod *corev1.Pod, containers []corev1.Container) {
for i, container := range containers {
srcRef, err := alltransports.ParseImageName("docker://" + container.Image)
if err != nil {
Expand Down

0 comments on commit 36d4bfc

Please sign in to comment.