versatile-data-kit: remove global image from Gitlab CI #2466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In GitLab CI, you can specify certain settings globally, affecting the entire CI/CD pipeline. These are called "global keys. There is a global key that defines a specific Docker image (image:)
Now, the problem arises when we define the same global key in multiple YAML files within the repository. Since global keys are not scoped to specific files, they can clash and cause conflicts. When GitLab processes the CI configuration, it reads all the YAML files and applies the settings in the order they are imported.
If the same global key appears in different files, the last occurrence of that key in the import order will overwrite the previous ones. This behavior can lead to unintended consequences. For example, we might encounter unexpected Docker images being used for certain jobs.
To prevent this from happening I am removing all global
image:
keys except in root level gitlab ci file to avoid any potential issues.Specific images needed are set on job-level which is scoped to a job. This is the best practice that we should follow and not rely on defaults.