-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into automate-olm-releasing
- Loading branch information
Showing
12 changed files
with
154 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.22 | ||
ARG GO_VERSION=1.23 | ||
|
||
FROM golang:${GO_VERSION}-bullseye AS builder | ||
|
||
|
This file contains 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/containers/nri-plugins | ||
|
||
go 1.22.10 | ||
go 1.23.4 | ||
|
||
require ( | ||
github.com/containerd/nri v0.6.0 | ||
|
This file contains 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,136 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
CHECK_IMAGES="\ | ||
nri-resource-policy-balloons \ | ||
nri-resource-policy-template \ | ||
nri-resource-policy-topology-aware \ | ||
nri-config-manager \ | ||
nri-memory-qos \ | ||
nri-memtierd \ | ||
nri-sgx-epc \ | ||
" | ||
|
||
CHECK_CHARTS="\ | ||
nri-resource-policy-balloons \ | ||
nri-resource-policy-template \ | ||
nri-resource-policy-topology-aware \ | ||
nri-memory-qos \ | ||
nri-memtierd \ | ||
nri-sgx-epc \ | ||
" | ||
|
||
CHECKS="all" | ||
|
||
IMAGE_URL="ghcr.io/containers/nri-plugins" | ||
INDEX_URL="https://containers.github.io/nri-plugins/index.yaml" | ||
|
||
info() { | ||
echo "$*" | ||
} | ||
|
||
error() { | ||
echo "ERROR: $*" >&2 | ||
} | ||
|
||
check-images() { | ||
local status=0 pkg img | ||
|
||
info "Checking images for version $VERSION..." | ||
for pkg in $CHECK_IMAGES; do \ | ||
img="$IMAGE_URL/$pkg" | ||
info " $img..." | ||
if ! result=$(skopeo inspect --format "$pkg: {{.Digest}}" "docker://$img:$VERSION"); then | ||
info " FAIL: $img:$VERSION NOT FOUND" | ||
status=1 | ||
else | ||
info " OK: $result" | ||
fi | ||
done | ||
|
||
return $status | ||
} | ||
|
||
check-helm-charts() { | ||
local status=0 pkg | ||
|
||
rm -f helm-index | ||
info "Downloading Helm index..." | ||
if ! wget -q $INDEX_URL -Ohelm-index; then | ||
error "Failed to download Helm index" | ||
return 1 | ||
fi | ||
|
||
info "Checking Helm charts for version $VERSION..." | ||
for pkg in $CHECK_CHARTS; do | ||
info " $pkg:$VERSION..." | ||
if [ $(cat helm-index | yq ".entries.$pkg[] | select(.version == \"$VERSION\") | length > 0") != "true" ]; then | ||
info " FAIL: Helm chart $pkg:$VERSION NOT FOUND" | ||
status=1 | ||
else | ||
info " OK: $pkg" | ||
fi | ||
done | ||
rm -f helm-index | ||
|
||
return $status | ||
} | ||
|
||
while [ $# -gt 0 ]; do | ||
case $1 in | ||
-h|--help) | ||
echo "Usage: $0 [--images] [--charts] <version-tag>" | ||
exit 0 | ||
;; | ||
--images|-i) | ||
CHECKS="images" | ||
;; | ||
--charts|--helm|-c) | ||
CHECKS="charts" | ||
;; | ||
*) | ||
if [ -n "$VERSION" ]; then | ||
error "Needs a single version but multiple given ($VERSION, $1)" | ||
exit 1 | ||
fi | ||
VERSION="$1" | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
if [ -z "$VERSION" ]; then | ||
error "Usage: $0 <version>" | ||
exit 1 | ||
fi | ||
|
||
status=0 | ||
|
||
if [ "$CHECKS" = "all" ] || [ "$CHECKS" = "images" ]; then | ||
if ! check-images; then | ||
status=1 | ||
else | ||
info "All expected images found." | ||
fi | ||
else | ||
info "Skipping image checks." | ||
fi | ||
|
||
if [ "$CHECKS" = "all" ] || [ "$CHECKS" = "charts" ]; then | ||
if ! check-helm-charts; then | ||
status=1 | ||
else | ||
info "All expected Helm charts found." | ||
fi | ||
else | ||
info "Skipping Helm chart checks." | ||
fi | ||
|
||
if [ $status -eq 0 ]; then | ||
info "SUCCESS: All expected artifacts for $VERSION found." | ||
else | ||
error "FAILED: Some artifacts for release $VERSION not found." | ||
fi | ||
|
||
exit $status |