[DEVOPS-123] Added optional ability to perform supported image versions checks. #32
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.
Description
Currently, PaaS customers have the ability to use unsupported image versions. This can introduce issues when an unsupported version of an image is being used (eg. PHP 7, when the last supported version is 8).
Proposed solution
Extend
docker-base-image
check to allow optional version constrain within theallowed
list, which will reject builds that do not adhere to the specified image version constraint.If the version constraint is added to the image, then that version will be considered the last supported version, meaning that images with lower version will not pass validation.
For version comparison it is proposed to use https://github.com/hashicorp/go-version that follows SemVer
Usage
The version constraint can be added either with
:
or@
suffix tag. When no version suffix is specified then any version will pass the validation (current behaviour)