Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-123] Added optional ability to perform supported image versions checks. #32

Conversation

barbun
Copy link
Contributor

@barbun barbun commented Jul 28, 2023

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 the allowed 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)

docker-base-image:
    - name: '[FILE] Allowed image lookup'
      paths:
        - ./
      allowed:
        - govcms/nginx-drupal:9.5.3
        - uselagoon/varnish-drupal@latest

Copy link
Contributor

@steveworley steveworley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change on the function name so that it better represents what the function is doing.

pkg/utils/utils.go Outdated Show resolved Hide resolved
Copy link
Contributor

@steveworley steveworley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@yusufhm yusufhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yusufhm yusufhm merged commit 5f15b80 into salsadigitalauorg:main Dec 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants