-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: use RELATED_IMAGES_ environment variables to configure operand's images #812
Open
osmman
wants to merge
3
commits into
main
Choose a base branch
from
tturek/related-images
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.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Replace images | ||
run: make dev-images && cat internal/controller/constants/images.go | ||
run: make dev-images && cat internal/images/images.env | ||
|
||
- name: Build operator container | ||
run: make docker-build docker-push | ||
|
@@ -51,7 +51,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Replace images | ||
run: make dev-images && cat internal/controller/constants/images.go | ||
run: make dev-images && cat internal/images/images.env | ||
|
||
- name: Build operator bundle | ||
run: make bundle bundle-build bundle-push | ||
|
@@ -228,7 +228,7 @@ jobs: | |
run: go install github.com/sigstore/cosign/v2/cmd/[email protected] | ||
|
||
- name: Replace images | ||
run: make dev-images && cat internal/controller/constants/images.go | ||
run: make dev-images && cat internal/images/images.env | ||
|
||
- name: Run tests | ||
run: make test-e2e | ||
|
@@ -300,7 +300,7 @@ jobs: | |
run: go install github.com/sigstore/cosign/v2/cmd/[email protected] | ||
|
||
- name: Replace images | ||
run: make dev-images && cat internal/controller/constants/images.go | ||
run: make dev-images && cat internal/images/images.env | ||
|
||
- name: Run tests | ||
env: | ||
|
@@ -365,7 +365,7 @@ jobs: | |
sudo echo "127.0.0.1 fulcio-server.local tuf.local rekor-server.local rekor-search-ui.local cli-server.local" | sudo tee -a /etc/hosts | ||
|
||
- name: Replace images | ||
run: make dev-images && cat internal/controller/constants/images.go | ||
run: make dev-images && cat internal/images/images.env | ||
|
||
- name: Run tests | ||
env: | ||
|
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
data: | ||
RELATED_IMAGE_BACKFILL_REDIS: registry.redhat.io/rhtas/rekor-backfill-redis-rhel9@sha256:6aa3ca40e0f9e32a0a211a930b21ff009b83e46609bfa5bb328979e4799d13c7 | ||
RELATED_IMAGE_CLIENT_SERVER: registry.redhat.io/rhtas/client-server-rhel9@sha256:9537329d0166b8d41ffd5f5d79c052fc27abe426a20cba5733c84030013c4e29 | ||
RELATED_IMAGE_CTLOG: registry.redhat.io/rhtas/certificate-transparency-rhel9@sha256:31e7318a9b19ed04ef0f25949f1f1709d293b532316b27a06f83fa5174547b17 | ||
RELATED_IMAGE_FULCIO_SERVER: registry.redhat.io/rhtas/fulcio-rhel9@sha256:4b5765bbfd3dac5fa027d2fb3d672b6ebffbc573b9413ab4cb189c50fa6f9a09 | ||
RELATED_IMAGE_HTTP_SERVER: registry.access.redhat.com/ubi9/httpd-24@sha256:7874b82335a80269dcf99e5983c2330876f5fe8bdc33dc6aa4374958a2ffaaee | ||
RELATED_IMAGE_REKOR_REDIS: registry.redhat.io/rhtas/trillian-redis-rhel9@sha256:18820b1fbdbc2cc3e917822974910332d937b03cfe781628bd986fd6a5ee318e | ||
RELATED_IMAGE_REKOR_SEARCH_UI: registry.redhat.io/rhtas/rekor-search-ui-rhel9@sha256:3c93c15fc5c918a91b3da9f5bf2276e4d46d881b1031287e6ab28e6aeb23e019 | ||
RELATED_IMAGE_REKOR_SERVER: registry.redhat.io/rhtas/rekor-server-rhel9@sha256:81e10e34f02b21bb8295e7b5c93797fc8c0e43a1a0d8304cca1b07415a3ed6f5 | ||
RELATED_IMAGE_SEGMENT_REPORTING: registry.redhat.io/rhtas/segment-reporting-rhel9@sha256:1b87ff1ad02c476c08e06038a26af7abe61f177e491a9ff42d507550a8587ac8 | ||
RELATED_IMAGE_TIMESTAMP_AUTHORITY: registry.redhat.io/rhtas/timestamp-authority-rhel9@sha256:fce0a22c8872309554236bab3457715dda0a83eb40dc6a9ecd3477b8023369d0 | ||
RELATED_IMAGE_TRILLIAN_DB: registry.redhat.io/rhtas/trillian-database-rhel9@sha256:501612745e63e5504017079388bec191ffacf00ffdebde7be6ca5b8e4fd9d323 | ||
RELATED_IMAGE_TRILLIAN_LOG_SERVER: registry.redhat.io/rhtas/trillian-logserver-rhel9@sha256:7af78c7bc4df097ffeeef345f1d13289695f715221957579ee65daeef2fa3f5b | ||
RELATED_IMAGE_TRILLIAN_LOG_SIGNER: registry.redhat.io/rhtas/trillian-logsigner-rhel9@sha256:2d707d12e4f65e1a92b4de11465a5976d55e15ad6c9fefe994646ccd44c83840 | ||
RELATED_IMAGE_TRILLIAN_NETCAT: registry.redhat.io/openshift4/ose-tools-rhel8@sha256:486b4d2dd0d10c5ef0212714c94334e04fe8a3d36cf619881986201a50f123c7 | ||
RELATED_IMAGE_TUF: registry.redhat.io/rhtas/tuffer-rhel9@sha256:79340be7918034c68a334a210ab872161827c99c2a1551a4fce8d5d27560a234 | ||
kind: ConfigMap | ||
metadata: | ||
name: rhtas-related-images |
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,54 @@ | ||
#!/bin/bash | ||
# | ||
# Usage: ./related-image-patch.sh inputfile | ||
osmman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# | ||
# This script reads an input file containing lines like: | ||
# VARIABLE_NAME=value | ||
# | ||
# It outputs a JSON object where each variable becomes an entry in | ||
# the "env" array with its name and corresponding value. | ||
# | ||
|
||
# Check that exactly one argument is provided. | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 inputfile" | ||
exit 1 | ||
fi | ||
|
||
inputfile="$1" | ||
|
||
# Start outputting the JSON structure. | ||
output='{"spec": {"config": {"env": [' | ||
|
||
first_entry=1 | ||
|
||
# Process the file line by line. | ||
while IFS= read -r line || [ -n "$line" ]; do | ||
# Skip empty lines or lines without an '=' character. | ||
if [ -z "$line" ] || [[ "$line" != *"="* ]]; then | ||
continue | ||
fi | ||
|
||
# Split the line into key and value. | ||
key="${line%%=*}" | ||
value="${line#*=}" | ||
|
||
# Print a comma before each JSON object except the first. | ||
if [ $first_entry -eq 0 ]; then | ||
output+="," | ||
fi | ||
|
||
# Append a newline to have each record on its own line. | ||
output+=$'\n' | ||
|
||
# Output the JSON object for this environment variable. | ||
output+="{\"name\": \"$key\", \"value\": \"$value\"}" | ||
|
||
first_entry=0 | ||
done < "$inputfile" | ||
|
||
# Close the JSON structure. | ||
output+=$'\n' | ||
output+=']}}}' | ||
|
||
echo "$output" |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this is needed by Kustomize but I don't think it is necessary to keep it as part of the bundle. Maybe we can add it to .gitignore WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it will be better to keep it. It will be better to try keep kustomize output as close to bundle/. For example
make build-installer
will generate resources with that config.