ci(nightly): Replace the operator image by its Sealights-instrumented counterpart if SL is enabled [RHDHBUGS-2050] - #1650
Conversation
…alights completely if needed
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR TypeEnhancement Description
|
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Enhancement |
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/nightly.yaml:217-223` </location>
<code_context>
--selector=app.kubernetes.io/component=controller \
--timeout=90s
+ - name: E2E prerequisites for Sealights
+ if: ${{ vars.SEALIGHTS_ENABLED == 'true' && steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }}
+ env:
+ SEALIGHTS_BOT_QUAY_USERNAME: ${{secrets.SEALIGHTS_BOT_QUAY_USERNAME}}
+ SEALIGHTS_BOT_QUAY_PASSWORD: ${{secrets.SEALIGHTS_BOT_QUAY_PASSWORD}}
+ run: |
+ kubectl create namespace rhdh-operator
+ # Needed because the Operator Sealights image is private
</code_context>
<issue_to_address>
**suggestion:** Check for idempotency in namespace and secret creation.
If the namespace or secret already exists, these commands will fail. To improve robustness, use 'kubectl apply' or add logic to handle existing resources without error.
```suggestion
kubectl get namespace rhdh-operator || kubectl create namespace rhdh-operator
# Needed because the Operator Sealights image is private
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \
--docker-server=quay.io \
--docker-username="$SEALIGHTS_BOT_QUAY_USERNAME" \
--docker-password="$SEALIGHTS_BOT_QUAY_PASSWORD" \
--docker-email=asoro@redhat.com || \
kubectl -n rhdh-operator delete secret rhdh-pull-secret && \
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \
--docker-server=quay.io \
--docker-username="$SEALIGHTS_BOT_QUAY_USERNAME" \
--docker-password="$SEALIGHTS_BOT_QUAY_PASSWORD" \
--docker-email=asoro@redhat.com
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
…erpart if SL is enabled
|
Merging so we can trigger the nightly workflow and see how it goes.. |
Description
Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer
Checked locally that this works by running a simple E2E test:
Summary by Sourcery
Enable optional SeaLights integration in nightly CI workflows and E2E tests by introducing a SEALIGHTS_ENABLED toggle, swapping the operator image for its instrumented variant, and configuring imagePullSecrets when needed.
New Features:
Enhancements:
CI:
Tests: