Skip to content

Do not pass in bash detection script into build container

John Cai requested to merge jc-bash-detection-in-shell into main

What does this MR do?

Currently we pass the bash shell detection script into the container build kubernetes api call, which overrides the docker image's entrypoint if it exists.

Since we already write the bash detection script into a file for the attached execution method, we no longer need to pass in the bash detection script into the container creation call.

This MR gets rid of this if the FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY is not set to true. This allows the entrypoint of the build image to be honored and the bash detection script continues to run.

Why was this MR needed?

The docker image's entrypoint was being overridden by the bash detection script.

What's the best way to test this MR?

Use the docker image registry.gitlab.com/gitlab-org/gitlab-runner/alpine-entrypoint:latest

The dockerfile for this image is here

Use the kubernetes executor to run a job

job:
  image:
    name: registry.gitlab.com/gitlab-org/gitlab-runner/alpine-entrypoint:latest
  script:
    - whoami
    - cat /tmp/debug.log

The job should succeed with the following logs:

image

What are the relevant issue numbers?

#4125 (closed)

Edited by John Cai

Merge request reports