-
Notifications
You must be signed in to change notification settings - Fork 2.2k
trusted-execution-clusters: Intro Azure upstream CI #79035
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?
Changes from all commits
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,31 @@ | ||
| base_images: | ||
| telco-runner: | ||
| name: telco-runner | ||
| namespace: ci | ||
| tag: latest | ||
| build_root: | ||
| image_stream_tag: | ||
| name: builder | ||
| namespace: ocp | ||
| tag: rhel-9-golang-1.25-openshift-4.21 | ||
| resources: | ||
| '*': | ||
| limits: | ||
| memory: 4Gi | ||
| requests: | ||
| cpu: 100m | ||
| memory: 200Mi | ||
| tests: | ||
| - as: operator-lifecycle-azure-verify | ||
| capabilities: | ||
| - intranet | ||
| skip_if_only_changed: ^(\.github|LICENSES|bundle|docs|examples)/|^(README\.md|\.gitignore)$ | ||
| steps: | ||
| test: | ||
| - chain: trusted-execution-clusters-operator-azure-lifecycle | ||
| post: | ||
| - chain: trusted-execution-clusters-operator-azure-cleanup | ||
| zz_generated_metadata: | ||
| branch: main | ||
| org: trusted-execution-clusters | ||
| repo: operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| reviewers: | ||
| - alicefr | ||
| - Jakob-Naucke | ||
| approvers: | ||
| - alicefr | ||
| - Jakob-Naucke |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| reviewers: | ||
| - alicefr | ||
| - Jakob-Naucke | ||
| approvers: | ||
| - alicefr | ||
| - Jakob-Naucke |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "path": "trusted-execution-clusters/operator-azure/cleanup/trusted-execution-clusters-operator-azure-cleanup-chain.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ], | ||
| "reviewers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| chain: | ||
| as: trusted-execution-clusters-operator-azure-cleanup | ||
| steps: | ||
| - ref: trusted-execution-clusters-ref-operator-azure-deprovision | ||
| documentation: |- | ||
| Azure tests create a Kind VM. Remove its resource group. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| reviewers: | ||
| - alicefr | ||
| - Jakob-Naucke | ||
| approvers: | ||
| - alicefr | ||
| - Jakob-Naucke |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "path": "trusted-execution-clusters/operator-azure/lifecycle/trusted-execution-clusters-operator-azure-lifecycle-chain.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ], | ||
| "reviewers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| chain: | ||
| as: trusted-execution-clusters-operator-azure-lifecycle | ||
| steps: | ||
| - ref: trusted-execution-clusters-ref-operator-azure-test | ||
| documentation: |- | ||
| Create a VM for Kind on Azure. Run integration tests with Azure VMs, testing against the operator on that Kind cluster. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| reviewers: | ||
| - alicefr | ||
| - Jakob-Naucke | ||
| approvers: | ||
| - alicefr | ||
| - Jakob-Naucke |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash -eu | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set -o pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "${SHARED_DIR}" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[ERROR] SHARED_DIR is not set. This script must run in Prow CI environment." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f "${SHARED_DIR}/az-resource-group" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[ERROR] az-resource-group was not placed in SHARED_DIR" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rpm --import https://packages.microsoft.com/keys/microsoft.asc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dnf install -y azure-cli | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| secret_base=/var/run/azure-upstream-ci | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| az login --service-principal \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --username "$(cat $secret_base/client-id)" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --password "$(cat $secret_base/client-secret)" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --tenant "$(cat $secret_base/tenant-id)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| az_resource_group=$(cat "${SHARED_DIR}/az-resource-group") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[INFO] Delete Kind VM resource group $az_resource_group" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| az group delete --name "$az_resource_group" --yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "[SUCCESS] Deleted Kind VM resource group $az_resource_group" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+27
Contributor
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. 🧩 Analysis chain🌐 Web query: `For Azure CLI, what are the documented outputs/exit semantics of:
💡 Result:
Citations:
Make the cleanup script idempotent to avoid failures in post-steps. The script hard-fails when the marker file is missing (exits with code 1) and deletes unconditionally without checking if the resource group still exists. In post-step execution, this causes noisy failures when these conditions aren't met. The script should treat "nothing to delete" and "already deleted" as success states. The suggested changes are valid:
This ensures the post-step completes without error whether resources were previously provisioned or already cleaned up. Suggested fix-if [ ! -f "${SHARED_DIR}/az-resource-group" ]; then
- echo "[ERROR] az-resource-group was not placed in SHARED_DIR"
- exit 1
+if [ ! -f "${SHARED_DIR}/az-resource-group" ]; then
+ echo "[WARN] az-resource-group not found; skipping Azure cleanup."
+ exit 0
fi
@@
-az_resource_group=$(cat "${SHARED_DIR}/az-resource-group")
+az_resource_group="$(<"${SHARED_DIR}/az-resource-group")"
+if [ -z "${az_resource_group}" ]; then
+ echo "[WARN] Empty az-resource-group; skipping Azure cleanup."
+ exit 0
+fi
echo "[INFO] Delete Kind VM resource group $az_resource_group"
-az group delete --name "$az_resource_group" --yes
+if [ "$(az group exists --name "$az_resource_group")" = "true" ]; then
+ az group delete --name "$az_resource_group" --yes
+else
+ echo "[INFO] Resource group $az_resource_group already absent; nothing to delete."
+fi
echo "[SUCCESS] Deleted Kind VM resource group $az_resource_group"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "path": "trusted-execution-clusters/ref/operator/azure-deprovision/trusted-execution-clusters-ref-operator-azure-deprovision-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ], | ||
| "reviewers": [ | ||
| "alicefr", | ||
| "Jakob-Naucke" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ref: | ||
| as: trusted-execution-clusters-ref-operator-azure-deprovision | ||
| from_image: | ||
| namespace: ci | ||
| name: telco-runner | ||
| tag: latest | ||
| commands: trusted-execution-clusters-ref-operator-azure-deprovision-commands.sh | ||
| credentials: | ||
| - namespace: test-credentials | ||
| name: azure-upstream-ci | ||
| mount_path: /var/run/azure-upstream-ci | ||
| resources: | ||
| requests: | ||
| cpu: 500m | ||
| memory: 500Mi | ||
| limits: | ||
| memory: 1Gi | ||
| documentation: |- | ||
| Azure tests create a Kind VM. Remove its resource group. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| reviewers: | ||
| - alicefr | ||
| - Jakob-Naucke | ||
| approvers: | ||
| - alicefr | ||
| - Jakob-Naucke |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/release
Length of output: 444
Guard
SHARED_DIRsafely underset -u.Line 4 expands
${SHARED_DIR}directly under nounset mode (-u), causing an unbound-variable error before the intended guard check runs. Use a default expansion to allow the condition to evaluate properly when the variable is unset.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents