-
Notifications
You must be signed in to change notification settings - Fork 137
Add workflow to validate UBI images pass RedHat Certification #4035
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
Open
shaun-nx
wants to merge
87
commits into
main
Choose a base branch
from
feat/pipeline-certfication-testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+100
−1
Open
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
2121f3b
Add workflow to validate UBI images pass RedHat Certification
shaun-nx d61c9f4
Update args and fix pre-commit checks
shaun-nx 2ffc89c
Add premissions and default run env
shaun-nx 34d29e7
Ensure Openshift ceritfication runs outside of prod release
shaun-nx 11cb2ec
Update dry_run input
shaun-nx c132f47
Ensure Openshift certification runs only on merges to main, and durin…
shaun-nx 7597193
Potential fix for code scanning alert no. 542: If expression always true
shaun-nx 9691208
tmp remove if check for certification job
shaun-nx bb8a349
Remove `--json` flag
shaun-nx f164607
Use check container instead of check operator
shaun-nx 8d908cf
Add steps to save and tag docker images for use by preflight checks
shaun-nx afc676e
change operator to container
shaun-nx 8ef4adb
Move image save and upload to build.yaml. Add debug echo for tags
shaun-nx 118145b
Update openshift certification job with new image tags
shaun-nx aafd707
Fix pre-commit errors
shaun-nx 893fdb1
Load images to Docker Daemon in build step. Run Openshift certificati…
shaun-nx 60388bb
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx 9a16ec5
Add image to input
shaun-nx 90f1618
Remove image version output
shaun-nx ff72dc3
Use docker buildx to ensure images for multi platforms are saved
shaun-nx ff3b959
Fix pre-commit errors
shaun-nx e76b660
Ensure image_version is passed to opernshift certification
shaun-nx b9cf4aa
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx cb8d8f9
Add image_version to inputs
shaun-nx a9d3eb9
Remove platform option
shaun-nx 7d185bf
Remove platform from `with`
shaun-nx 4fbeed6
Log into container reg to upload images
shaun-nx 6f9f14b
Add debugging echo for tags
shaun-nx 912a3ff
Only export and upload UBI images
shaun-nx 5064ef6
Fix inputs
shaun-nx a219d77
Fix export step
shaun-nx afc4c36
Debug docker buildx
shaun-nx e0b7b9a
Update Buildx step
shaun-nx fd02d12
Debug export command
shaun-nx ce3f4c6
Use docker save instead of buildx
shaun-nx f5adba0
Change load command and if check for saving
shaun-nx 9cbee53
Fix yamllint errors
shaun-nx d75ade3
Move tarball to workspace root
shaun-nx 4fad413
Update mv command
shaun-nx aeb55e6
Debug downloaded artifacts
shaun-nx decd459
Remove mv step
shaun-nx 0db0eff
Update Checkout Repository command
shaun-nx 8decbcb
Add tag and dry_run input
shaun-nx 83e216d
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx e45fb54
Debug artifact upload and download
shaun-nx b75a370
Fix pre-commit errors
shaun-nx 887362e
Update upload step
shaun-nx 113e43b
Fix artifact name
shaun-nx bd667db
Fix artifact name
shaun-nx 109a18d
Change name format
shaun-nx 889ba70
Fix upload name
shaun-nx c6838b2
Re add steps to load and run preflight tool
shaun-nx ee1d63d
Add image tags for quay.io
shaun-nx 8f3cfc0
temp: allow images to be pushed to quay.io during PRs
shaun-nx dad38c0
Add quay login to build.yml
shaun-nx 7354392
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx 59857e6
Update preflight run step
shaun-nx a02fbe8
Fix indentation
shaun-nx c7f2ab9
Add logout: false
shaun-nx ed6878a
Fix run preflight command
shaun-nx e1003bc
Fix image name
shaun-nx 5a252d8
Ensure only UBI images are pushed to quay.io
shaun-nx a2d4762
Update images and preflight run step
shaun-nx de68998
Fix yamllint
shaun-nx 21ac62b
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx a351f50
Fix image reference
shaun-nx bb98927
Apped ubi to image version
shaun-nx 8abbf61
Ensure correct tags are passed to preflight job
shaun-nx a6bc92f
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx 695c5b6
Fix `if` check in certification job
shaun-nx 5100b57
Fix image version input
shaun-nx b7482df
Add operator to image version
shaun-nx 2eb9464
Run preflight checks on images pushed to ghcr.io and only run checks …
shaun-nx 42bdd4d
Test against existing edge ghcr images
shaun-nx d451e1b
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx c49f43c
Remove duplicate step
shaun-nx 36b1430
Test: Run openshift certification on PRs
shaun-nx fc1c94d
Fix EOF error
shaun-nx 02fd063
Fix variable
shaun-nx bd33296
Fix repo
shaun-nx 1ff669b
Enaure we can log into reg
shaun-nx 7a5d894
Add platform to matrix
shaun-nx cf0dc37
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx ee43213
Add platform to inputs
shaun-nx 76e9317
Update platforms in matrix
shaun-nx 9697b76
Ensure openshift certificaiton only runs on merges to main and releases
shaun-nx 022c27a
Merge branch 'main' into feat/pipeline-certfication-testing
shaun-nx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: OpenShift Certification | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
required: true | ||
type: string | ||
platform: | ||
required: true | ||
type: string | ||
image_version: | ||
required: true | ||
type: string | ||
tag: | ||
required: false | ||
type: string | ||
default: '' | ||
dry_run: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
preflight: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
ref: ${{ (inputs.tag != '' && !inputs.dry_run ) && format('refs/tags/v{0}', inputs.tag) || github.ref }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | ||
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download preflight binary | ||
run: | | ||
curl -LO https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/latest/download/preflight-linux-amd64 | ||
chmod +x preflight-linux-amd64 | ||
sudo mv preflight-linux-amd64 /usr/local/bin/preflight | ||
|
||
- name: Run preflight | ||
env: | ||
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }} | ||
run: | | ||
if [[ "${{ inputs.image }}" == "ngf" ]]; then | ||
IMAGE_PATH="ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric:${{ inputs.image_version }}" | ||
else | ||
IMAGE_PATH="ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/${{ inputs.image }}:${{ inputs.image_version }}" | ||
fi | ||
preflight check container "$IMAGE_PATH" --platform ${{ inputs.platform }} > preflight-result.json | ||
|
||
- name: Check preflight results | ||
run: | | ||
failed_count=$(jq '.results.failed | length' preflight-result.json) | ||
if [ "$failed_count" -ne 0 ]; then | ||
shaun-nx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Preflight checks failed: $failed_count failed checks" | ||
echo "Results for preflight-result.json:" | ||
jq '.results.failed' preflight-result.json | ||
exit 1 | ||
fi |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.