Skip to content

Sanitize image entrypoint to remove empty string

Romuald Atchadé requested to merge k8s-handle-empty-entrypoint into main

What does this MR do?

With the Community contribution !4394 (merged), the entrypoint defined for the image in the gitlab-ci.yaml is now used in both build and helper containers. Since the introduction of this MR, the runner incept test kubernetes-kaniko-build-attach-mode has started failing with the following error:

...
Executing "step_script" stage of the job script                                                                                  00:00
Running after_script                                                                                                             00:00
WARNING: after_script failed, but job will continue unaffected: unable to upgrade connection: container not found ("build")
Cleaning up project directory and file based variables                                                                           00:00
ERROR: Job failed (system failure): unable to upgrade connection: container not found ("build")

After investigation, I realized that it was because the gitlab-ci of this test defines entrypoint: [""] as image entrypoint. This entrypoint is not empty but contains only an empty string.

In order to avoid to break possible setup with a similar configuration, a fix was implemented to filter out image>entrypoint from empty string before considering if it is a valid (or not) value.

Why was this MR needed?

Make sure that the image>entrypoint is valid

What's the best way to test this MR?

The runner incept test kubernetes-kaniko-build-attach-mode should not fail anymore with the error mentioned above.

What are the relevant issue numbers?

N/A

Merge request reports