-
Couldn't load subscription status.
- Fork 41
First commit for upgrade #1368
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
base: main
Are you sure you want to change the base?
First commit for upgrade #1368
Changes from 7 commits
548db5d
33cfefa
f0ebc6b
93b1480
480d5eb
c8baf28
0775550
e9b340c
ab6e2be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,196 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Upgrade CI test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # - main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: # Runs on any direct push to any branch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| k8s: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout tackle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repository: konveyor/tackle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: tackle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout to branch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Get Initial Branch Name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: echo "INIT_BRANCH=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install operator-sdk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v operator-sdk >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "operator-sdk is already installed...yay" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v1.35.0/operator-sdk_linux_amd64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo install -o root -g root -m 0755 operator-sdk_linux_amd64 /usr/local/bin/operator-sdk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install kubectl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v kubectl >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "kubectl is already installed...yay" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Installing oc binary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v oc >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "oc is already installed...yay" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OC_VERSION=$(curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/release.txt | grep 'Name:' | awk '{print $2}') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar -xzf openshift-client-linux.tar.gz oc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo mv oc /usr/local/bin/oc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oc version --client | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install opm cli | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v opm >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "opm is already installed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export OPM_VERSION=$(curl -s https://api.github.com/repos/operator-framework/operator-registry/releases/latest | grep tag_name | cut -d '"' -f 4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Download the binary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -Lo opm-linux-amd64 "https://github.com/operator-framework/operator-registry/releases/download/${OPM_VERSION}/linux-amd64-opm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x opm-linux-amd64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo mv opm-linux-amd64 /usr/local/bin/opm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| opm version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+65
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Extend checksum/sig verification to the The OPM CLI is fetched from GitHub and installed with root privileges, yet no integrity check is performed. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set Environment Variables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create and push index image to quay | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bash hack/create-index-image.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup minikube | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: konveyor/tackle2-operator/.github/actions/start-minikube@main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| memory: 'max' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cpus: 'max' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Enable olm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: minikube addons enable olm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Enable ingress addon | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run : minikube addons enable ingress | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+90
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
- - name: Enable ingress addon
- run : minikube addons enable ingress
+ - name: Enable ingress addon
+ run: minikube addons enable ingress📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.37.1)[warning] 79-79: too many spaces before colon (colons) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install Pre Upgrade konveyor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bash hack/install-preupgrade-konveyor.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set preupgrade konveyor value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| konveyor_version=$(kubectl get csv -n konveyor-tackle -o=custom-columns=:spec.version | head -n 2 | tr -d '[:space:]') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "cypress_mtaVersion=$konveyor_version" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Konveyor version: $konveyor_version" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Display konveyor version for confirmation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Confirming konveyor version from environment variable: $cypress_mtaVersion" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Environment variable cypress_mtaVersion value: ${{ env.cypress_mtaVersion }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Use mtaVersion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: echo "Konveyor version is $cypress_mtaVersion" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Check pod status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: kubectl get pods -n konveyor-tackle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Wait for Ingress | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bash -c 'external_ip=""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo $external_ip; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| while [[ -z $external_ip ]] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Waiting for end point..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| external_ip=$(kubectl get ingress tackle --template="{{range.status.loadBalancer.ingress}}{{.ip}}{{end}}" -n konveyor-tackle);[[ -z $external_ip ]] && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo $external_ip; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| while [[ -z $external_ip ]] | |
| do | |
| echo "Waiting for end point..." | |
| external_ip=$(kubectl get ingress tackle --template="{{range.status.loadBalancer.ingress}}{{.ip}}{{end}}" -n konveyor-tackle);[[ -z $external_ip ]] && | |
| echo $external_ip; | |
| while [[ -z $external_ip ]] | |
| do | |
| echo "Waiting for end point..." | |
| external_ip=$(kubectl get ingress tackle -n konveyor-tackle \ | |
| -o jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null) || true | |
| [[ -z "$external_ip" ]] && echo $external_ip; |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents
In .github/workflows/upgrade-ci.yml around lines 100 to 104, the kubectl command
incorrectly uses the invalid --template flag causing it to fail and the loop to
spin forever. Replace --template with the correct -o go-template flag and quote
all variable expansions to avoid word splitting issues. Additionally, add a
timeout mechanism to the loop by setting an end time (e.g.,
end=$((SECONDS+300))) and break the loop if the timeout is reached to prevent
infinite looping.
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.
🛠️ Refactor suggestion
Use the resolved ingress IP instead of Minikube’s node IP
You work hard to poll external_ip but then ignore it:
- export endpoint=$(minikube ip);
- echo "CYPRESS_tackleUrl=https://$endpoint" >>$GITHUB_ENV'
+ endpoint="$external_ip"
+ echo "CYPRESS_tackleUrl=https://$endpoint" >>"$GITHUB_ENV"This ensures tests hit the actual ingress rather than the node-IP, which may not route correctly with ingress enabled.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export endpoint=$(minikube ip); | |
| echo "CYPRESS_tackleUrl=https://$endpoint" >>$GITHUB_ENV' | |
| endpoint="$external_ip" | |
| echo "CYPRESS_tackleUrl=https://$endpoint" >>"$GITHUB_ENV" |
🤖 Prompt for AI Agents
In .github/workflows/upgrade-ci.yml at lines 111-112, replace the use of
Minikube's node IP with the resolved ingress IP by using the previously polled
`external_ip` variable instead of calling `minikube ip`. Update the export line
to assign `endpoint` to the `external_ip` value so that the tests target the
ingress IP, ensuring correct routing through ingress.
Outdated
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.
🛠️ Refactor suggestion
Wait for Ingress loop can hang forever & misses quoting
The while-loop lacks a timeout and uses unquoted variable expansions flagged by ShellCheck (SC2086). A safer, bounded version:
-run: |
- bash -c 'external_ip="";
- ...
- while [[ -z $external_ip ]]
- do
- ...
- done
- ...
- echo "CYPRESS_tackleUrl=https://$endpoint" >>$GITHUB_ENV'
+run: |
+ set -eo pipefail
+ timeout=300 # 5 min
+ end=$((SECONDS+timeout))
+ while [[ -z "${external_ip:-}" && $SECONDS -lt $end ]]; do
+ echo "Waiting for ingress…"
+ external_ip=$(kubectl get ingress tackle -n konveyor-tackle \
+ --template='{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}')
+ sleep 10
+ done
+ [[ -z $external_ip ]] && { echo "::error::Ingress not ready in ${timeout}s"; exit 1; }
+ echo "Ingress IP: $external_ip"
+ echo "CYPRESS_tackleUrl=https://$(minikube ip)" >> "$GITHUB_ENV"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Wait for Ingress | |
| shell: bash | |
| run: | | |
| bash -c 'external_ip=""; | |
| echo $external_ip; | |
| while [[ -z $external_ip ]] | |
| do | |
| echo "Waiting for end point..." | |
| external_ip=$(kubectl get ingress tackle --template="{{range.status.loadBalancer.ingress}}{{.ip}}{{end}}" -n konveyor-tackle);[[ -z $external_ip ]] && | |
| echo $external_ip; | |
| sleep 10; | |
| done | |
| echo "End point ready:" && | |
| echo $external_ip; | |
| export endpoint=$(minikube ip); | |
| echo "CYPRESS_tackleUrl=https://$endpoint" >>$GITHUB_ENV' | |
| git branch | |
| - name: Wait for Ingress | |
| shell: bash | |
| run: | | |
| set -eo pipefail | |
| timeout=300 # 5 min | |
| end=$((SECONDS + timeout)) | |
| while [[ -z "${external_ip:-}" && SECONDS -lt end ]]; do | |
| echo "Waiting for ingress…" | |
| external_ip=$(kubectl get ingress tackle \ | |
| -n konveyor-tackle \ | |
| --template='{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}') | |
| sleep 10 | |
| done | |
| [[ -z $external_ip ]] && { | |
| echo "::error::Ingress not ready in ${timeout}s" | |
| exit 1 | |
| } | |
| echo "Ingress IP: $external_ip" | |
| echo "CYPRESS_tackleUrl=https://$(minikube ip)" >> "$GITHUB_ENV" | |
| git branch |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 103-103: trailing spaces
(trailing-spaces)
[error] 104-104: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents
In .github/workflows/upgrade-ci.yml between lines 98 and 114, the 'Wait for
Ingress' step's while-loop can hang indefinitely and uses unquoted variable
expansions, which is unsafe. To fix this, add a timeout counter to break the
loop after a reasonable number of attempts, and quote all variable expansions
like "$external_ip" to prevent word splitting and globbing issues. This ensures
the loop terminates and the script is more robust.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| #!/bin/bash | ||||||
|
|
||||||
| set -E | ||||||
| set -e | ||||||
| set -x | ||||||
| set -o pipefail | ||||||
|
|
||||||
| SOURCE_UPGRADE_BUNDLE_IMAGE="${OPERATOR_BUNDLE_IMAGE:-quay.io/konveyor/tackle2-operator-bundle:v0.6.0}" | ||||||
| TARGET_UPGRADE_BUNDLE_IMAGE="${OPERATOR_BUNDLE_IMAGE:-quay.io/konveyor/tackle2-operator-bundle:latest}" | ||||||
|
||||||
|
|
||||||
| echo 'Creating bundle image using $SOURCE_UPGRADE_BUNDLE_IMAGE and $TARGET_UPGRADE_BUNDLE_IMAGE' | ||||||
|
||||||
| echo 'Creating bundle image using $SOURCE_UPGRADE_BUNDLE_IMAGE and $TARGET_UPGRADE_BUNDLE_IMAGE' | |
| echo "Creating bundle image using ${SOURCE_UPGRADE_BUNDLE_IMAGE} and ${TARGET_UPGRADE_BUNDLE_IMAGE}" |
🤖 Prompt for AI Agents
In hack/create-index-image.sh at line 11, the echo statement uses single quotes
which prevent variable expansion. Change the single quotes to double quotes so
that $SOURCE_UPGRADE_BUNDLE_IMAGE and $TARGET_UPGRADE_BUNDLE_IMAGE are expanded
and their values are printed in the log.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| NAMESPACE="${NAMESPACE:-konveyor-tackle}" | ||
| TEMPLATE_DIR="${TEMPLATE_DIR:-hack/templates}" | ||
| KONVEYOR_UPGRADE_INDEX="${KONVEYOR_UPGRADE_INDEX:-quay.io/migqe/tackle2-operator-upgrade-index:latest}" | ||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a proper she-bang and fail-fast flags Without a she-bang the script inherits +#!/usr/bin/env bash
+set -euo pipefail
NAMESPACE="${NAMESPACE:-konveyor-tackle}"
TEMPLATE_DIR="${TEMPLATE_DIR:-hack/templates}"
KONVEYOR_UPGRADE_INDEX="${KONVEYOR_UPGRADE_INDEX:-quay.io/migqe/tackle2-operator-upgrade-index:latest}"🧰 Tools🪛 Shellcheck (0.10.0)[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148) 🤖 Prompt for AI Agents |
||
| SUBSCRIPTION_CHANNEL="${SUBSCRIPTION_CHANNEL:-development}" | ||
| PREUPGRADE_VERSION="${PREUPGRADE_VERSION:-0.6.0}" | ||
| POSTUPGRADE_VERSION="${POSTUPGRADE_VERSION:-99.0.0}" #Always the latest from main. | ||
| TIMEOUT=300 # Maximum wait time in seconds (5 minutes) | ||
| INTERVAL=10 # Time to wait between checks (10 seconds) | ||
| ELAPSED=0 | ||
|
|
||
|
|
||
| echo "Patch subscription channel to ${SUBSCRIPTION_CHANNEL}" | ||
| kubectl patch sub konveyor-operator -n konveyor-tackle --type=merge -p "{\"spec\":{\"channel\":\"${SUBSCRIPTION_CHANNEL}\"}}" | ||
|
|
||
|
Comment on lines
+13
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Hard-coded namespace ignores the configurable -kubectl patch sub konveyor-operator -n konveyor-tackle --type=merge -p "{\"spec\":{\"channel\":\"${SUBSCRIPTION_CHANNEL}\"}}"
+kubectl patch sub konveyor-operator -n "${NAMESPACE}" --type=merge \
+ -p "{\"spec\":{\"channel\":\"${SUBSCRIPTION_CHANNEL}\"}}"🤖 Prompt for AI Agents |
||
| echo "Patching installplan for konveyor..." | ||
|
|
||
| kubectl patch installplan $(kubectl get installplan -n "${NAMESPACE}" | egrep "$POSTUPGRADE_VERSION"|awk '{print $1}') -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}' | ||
|
|
||
|
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Quote command substitution to avoid word-splitting If -kubectl patch installplan $(kubectl get installplan -n "${NAMESPACE}" | egrep "$POSTUPGRADE_VERSION"|awk '{print $1}') -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}'
+kubectl patch installplan "$(kubectl get installplan -n "${NAMESPACE}" \
+ | grep -E "$POSTUPGRADE_VERSION" | awk '{print $1}')" \
+ -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}'🧰 Tools🪛 Shellcheck (0.10.0)[warning] 17-17: Quote this to prevent word splitting. (SC2046) 🤖 Prompt for AI Agents |
||
| kubectl wait --namespace "${NAMESPACE}" --for=condition=Successful --timeout=600s tackles.tackle.konveyor.io/tackle | ||
|
|
||
| kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=tackle-ui -n "${NAMESPACE}" --timeout=300s | ||
|
|
||
| echo "Waiting for UI pod to be replaced after upgrade..." | ||
| echo "Previous UI Pod: $PREUPGRADE_UI_POD" | ||
|
|
||
| while true; do | ||
| # Get the current UI pod name | ||
| UI_POD_AFTER=$(kubectl get pods -n "${NAMESPACE}" -l app.kubernetes.io/name=tackle-ui -o name) | ||
|
|
||
| # Check if the pod has changed | ||
| if [[ "$PREUPGRADE_UI_POD" != "$UI_POD_AFTER" ]]; then | ||
| echo "UI pod has changed! New pod: $UI_POD_AFTER" | ||
| break | ||
| fi | ||
|
|
||
| # Check if timeout is reached | ||
| if [[ "$ELAPSED" -ge "$TIMEOUT" ]]; then | ||
| echo "Timeout reached! Pod did not change within $TIMEOUT seconds." | ||
| exit 1 # Fail the script if pod did not bounce | ||
| fi | ||
|
|
||
| echo "Pod has not changed yet. Retrying in $INTERVAL seconds..." | ||
| sleep $INTERVAL | ||
| ((ELAPSED+=INTERVAL)) | ||
| done | ||
|
||
| sleep 200s | ||
|
|
||
| kubectl get po -n "${NAMESPACE}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| NAMESPACE="${NAMESPACE:-konveyor-tackle}" | ||
| TEMPLATE_DIR="${TEMPLATE_DIR:-hack/templates}" | ||
| KONVEYOR_UPGRADE_INDEX="${KONVEYOR_UPGRADE_INDEX:-quay.io/migqe/tackle2-operator-upgrade-index:latest}" | ||
|
||
| SUBSCRIPTION_CHANNEL="${SUBSCRIPTION_CHANNEL:-konveyor-0.6}" | ||
| PREUPGRADE_VERSION="${PREUPGRADE_VERSION:-0.6.0}" | ||
| POSTUPGRADE_VERSION="${POSTUPGRADE_VERSION:-99.0.0}" #Always the latest from main. | ||
| echo "Creating namespace" | ||
| echo "${SUBSCRIPTION_CHANNEL}" | ||
| source "${TEMPLATE_DIR}/01_namespace.sh" | ||
|
|
||
| source "${TEMPLATE_DIR}/02_catsrc.sh" | ||
|
|
||
| source "${TEMPLATE_DIR}/03_operatorgroup.sh" | ||
|
|
||
| source "${TEMPLATE_DIR}/04_subscription.sh" | ||
|
|
||
| kubectl get sub -n konveyor-tackle -o yaml #Remove later | ||
|
|
||
|
||
| sleep 60s | ||
| echo "Patching installplan for konveyor..." | ||
|
|
||
| kubectl get installplan -n "${NAMESPACE}" | ||
|
|
||
| kubectl patch installplan $(kubectl get installplan -n "${NAMESPACE}" | egrep "$PREUPGRADE_VERSION"|awk '{print $1}') -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}' | ||
|
|
||
| sleep 20s | ||
|
|
||
| source "${TEMPLATE_DIR}/05_tacklecr.sh" | ||
|
|
||
| kubectl wait --namespace "${NAMESPACE}" --for=condition=Successful --timeout=600s tackles.tackle.konveyor.io/tackle | ||
| kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=tackle-ui -n "${NAMESPACE}" --timeout=300s | ||
| PREUPGRADE_UI_POD=$(kubectl get pod -l app.kubernetes.io/name=tackle-ui -n "${NAMESPACE}" -o name) | ||
| echo "PREUPGRADE_UI_POD=$PREUPGRADE_UI_POD" >> $GITHUB_ENV | ||
| sleep 120s | ||
|
|
||
| kubectl get po -n "${NAMESPACE}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| cat <<EOF | kubectl apply -f - | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: "${NAMESPACE}" | ||
| EOF | ||
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cat << EOF | kubectl create -f - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: operators.coreos.com/v1alpha1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: CatalogSource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: konveyor-tackle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace: "${NAMESPACE}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| displayName: Konveyor Operator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| publisher: Konveyor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sourceType: grpc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: "${KONVEYOR_UPGRADE_INDEX}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updateStrategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| registryPoll: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| interval: 10m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cat << EOF | kubectl create -f - | |
| apiVersion: operators.coreos.com/v1alpha1 | |
| kind: CatalogSource | |
| metadata: | |
| name: konveyor-tackle | |
| namespace: "${NAMESPACE}" | |
| spec: | |
| displayName: Konveyor Operator | |
| publisher: Konveyor | |
| sourceType: grpc | |
| image: "${KONVEYOR_UPGRADE_INDEX}" | |
| updateStrategy: | |
| registryPoll: | |
| interval: 10m | |
| EOF | |
| cat << EOF | kubectl apply -f - | |
| apiVersion: operators.coreos.com/v1alpha1 | |
| kind: CatalogSource | |
| metadata: | |
| name: konveyor-tackle | |
| namespace: "${NAMESPACE}" | |
| spec: | |
| displayName: Konveyor Operator | |
| publisher: Konveyor | |
| sourceType: grpc | |
| image: "${KONVEYOR_UPGRADE_INDEX}" | |
| updateStrategy: | |
| registryPoll: | |
| interval: 10m | |
| EOF |
🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🤖 Prompt for AI Agents
In hack/templates/02_catsrc.sh lines 1 to 15, replace the use of 'kubectl
create' with 'kubectl apply' to make the script idempotent. This change ensures
that rerunning the script does not fail if the CatalogSource resource already
exists, allowing repeated executions without errors.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| cat << EOF | kubectl create -f - | ||
|
||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| name: konveyor-tackle | ||
| namespace: "${NAMESPACE}" | ||
| spec: | ||
| targetNamespaces: | ||
| - konveyor-tackle | ||
|
||
| EOF | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| cat <<EOF | kubectl apply -f - | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: konveyor-operator | ||
| namespace: "${NAMESPACE}" | ||
| spec: | ||
| channel: "${SUBSCRIPTION_CHANNEL}" | ||
| installPlanApproval: "Manual" | ||
|
||
| name: konveyor-operator | ||
| source: konveyor-tackle | ||
| sourceNamespace: konveyor-tackle | ||
| EOF | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| cat <<EOF | kubectl apply -f - | ||
| kind: Tackle | ||
| apiVersion: tackle.konveyor.io/v1alpha1 | ||
| metadata: | ||
| name: tackle | ||
| namespace: "${NAMESPACE}" | ||
| spec: | ||
| feature_auth_required: "true" | ||
| EOF |
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.
ocbinary also lacks checksum verificationYou extract and install
ocwith root privileges but never validate the archive.Add SHA-256 (or GPG) verification to avoid executing a tampered binary.
🤖 Prompt for AI Agents