Skip to content

operator [O] aqua (6.5.1) #10

operator [O] aqua (6.5.1)

operator [O] aqua (6.5.1) #10

Workflow file for this run

name: Operator test
on:
pull_request_target:
types: [opened, reopened, synchronize, unlabeled]
branches:
- master
- main
env:
OPP_DEBUG: 1
OPP_CONTAINER_OPT: "-t"
OPP_SCRIPT_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp.sh"
OPP_SCRIPT_ENV_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-env.sh"
OPP_SCRIPT_ENV_OPRT_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-oprt.sh"
OPP_IMAGE: "quay.io/operator_testing/operator-test-playbooks:latest"
OPP_ANSIBLE_PULL_REPO: "https://github.com/redhat-openshift-ecosystem/operator-test-playbooks"
OPP_ANSIBLE_PULL_BRANCH: "upstream-community"
OPP_THIS_REPO_BASE: "https://github.com"
OPP_THIS_REPO: "k8s-operatorhub/community-operators"
OPP_THIS_BRANCH: "main"
OPP_RELEASE_BUNDLE_REGISTRY: "quay.io"
OPP_RELEASE_BUNDLE_ORGANIZATION: "operatorhubio"
OPP_RELEASE_INDEX_REGISTRY: "quay.io"
OPP_RELEASE_INDEX_ORGANIZATION: "operatorhubio"
OPP_RELEASE_INDEX_NAME: "catalog"
OPP_MIRROR_INDEX_MULTIARCH_BASE: "registry.redhat.io/openshift4/ose-operator-registry:v4.5"
OPP_MULTIARCH_SUPPORTED_VERSIONS: "v4.5 v4.6 v4.7"
OPP_MIRROR_INDEX_MULTIARCH_POSTFIX: "s"
IIB_INPUT_REGISTRY_USER: "jbreza"
OPP_PROD: 0
OPP_DRY_RUN: 0
KIND_KUBE_VERSION: "v1.21.1"
OPP_PRODUCTION_TYPE: "k8s"
OPP_REVIEWERS_ENABLED: 1
# ARTEFACT_PATH: "/tmp/operator-test" #hardcoded for now
jobs:
pr-check:
if: (!contains(github.event.pull_request.labels.*.name, 'do-not-merge/hold'))
name: "PR-traffic-light"
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- name: Operator traffic light
id: op-traffic-light
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_PR_AUTHOR: "${{ github.event.pull_request.user.login }}"
OPP_OPRT_REPO: "${{ github.event.pull_request.head.repo.full_name }}"
OPP_OPRT_SHA: "${{ github.event.pull_request.head.sha }}"
OPP_OPRT_SRC_REPO: "${{ github.event.pull_request.base.repo.full_name }}"
OPP_OPRT_SRC_BRANCH: "${{ github.event.pull_request.base.ref }}"
run: |
echo "Using script '$OPP_SCRIPT_ENV_OPRT_URL' ..."
echo "global labels $OPP_LABELS"
bash <(curl -sL $OPP_SCRIPT_ENV_OPRT_URL)
- name: Operator info
id: op-info
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_PR_AUTHOR: "${{ github.event.pull_request.user.login }}"
OPP_OPRT_REPO: "${{ github.event.pull_request.head.repo.full_name }}"
OPP_OPRT_SHA: "${{ github.event.pull_request.head.sha }}"
OPP_OPRT_SRC_REPO: "${{ github.event.pull_request.base.repo.full_name }}"
OPP_OPRT_SRC_BRANCH: "${{ github.event.pull_request.base.ref }}"
OPP_AUTO_LABEL: "${{ steps.op-traffic-light.outputs.opp_auto_packagemanifest_cluster_version_label }}"
ANSIBLE_FORCE_COLOR: 1
ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0
ANSIBLE_STDOUT_CALLBACK: "yaml"
run: |
# OPP_ANSIBLE_PULL_BRANCH="upstream-community-dev"
[ "$OPP_AUTO_LABEL" = '1' ] && ANSIBLE_ARGS="-e automatic_cluster_version_label=true" || ANSIBLE_ARGS="-e automatic_cluster_version_label=false"
ansible-pull -U $OPP_ANSIBLE_PULL_REPO -C $OPP_ANSIBLE_PULL_BRANCH -i localhost, -e run_upstream=true -e run_prepare_catalog_repo_upstream=false -e run_remove_catalog_repo=false upstream/local.yml --tags reset_tools,operator_info -e operator_dir=$PWD/operators/operators/${{ steps.op-traffic-light.outputs.opp_name }} -e cluster_type=$OPP_PRODUCTION_TYPE -e strict_cluster_version_labels=true -e production_registry_namespace=$OPP_RELEASE_BUNDLE_REGISTRY/$OPP_RELEASE_BUNDLE_ORGANIZATION $ANSIBLE_ARGS
- name: Upload operator_info
uses: actions/upload-artifact@v2
with:
name: operator_info
path: "/tmp/operator-test/op_info.yaml"
- name: Upload converted operators
uses: actions/upload-artifact@v2
with:
name: operators_converted
path: "/tmp/operator-test/operators"
- shell: bash
run: |
ls /tmp/operator-test/
cat /tmp/operator-test/op_info.yaml
outputs:
opp_test_ready: "${{ steps.op-traffic-light.outputs.opp_test_ready }}"
opp_release_ready: "${{ steps.op-traffic-light.outputs.opp_release_ready }}"
opp_stream: "${{ steps.op-traffic-light.outputs.opp_stream }}"
opp_name: "${{ steps.op-traffic-light.outputs.opp_name }}"
opp_version: "${{ steps.op-traffic-light.outputs.opp_version }}"
opp_ci_yaml_only: "${{ steps.op-traffic-light.outputs.opp_ci_yaml_only }}"
opp_op_delete: "${{ steps.op-traffic-light.outputs.opp_op_delete }}"
opp_auto_packagemanifest_cluster_version_label: "${{ steps.op-traffic-light.outputs.opp_auto_packagemanifest_cluster_version_label }}"
test-kiwi:
name: "kiwi / Full operator test"
needs: pr-check
if: needs.pr-check.outputs.opp_test_ready == '1'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download operator_info
uses: actions/download-artifact@v2
with:
name: operator_info
path: "/tmp/operator-test/"
- name: Download converted operators
uses: actions/download-artifact@v2
with:
name: operators_converted
path: "/tmp/operator-test/operators"
- name: Debug artefacts
shell: bash
run: |
ls /tmp/operator-test/operators
head /tmp/operator-test/op_info.yaml
- name: Operator test
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
run: |
echo "kiwi operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
bash <(curl -sL $OPP_SCRIPT_URL) kiwi "operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
- name: Search operator test error olm.maxOpenShiftVersion error
id: op-kiwi-test-err-maxOpenShiftVersion
if: always()
run: |
ERR_LINES=$(cat /tmp/op-test/log.out | grep 'not specified olm.maxOpenShiftVersion' | wc -l)
echo "opp_check_err_maxOpenShiftVersion=$ERR_LINES"
echo "::set-output name=opp_check_err_maxOpenShiftVersion::$ERR_LINES"
- name: "Comment operator test error olm.maxOpenShiftVersion"
if: always() && steps.op-kiwi-test-err-maxOpenShiftVersion.outputs.opp_check_err_maxOpenShiftVersion != '0'
uses: mshick/add-pr-comment@v1
with:
message: |
Dear @${{ github.event.pull_request.user.login }},
:warning: | Your operator (`${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}`) might **not** run on k8s 1.22 or in the Openshift version 4.9. **For more info see details bellow.**
:---: | :--- |
**IMPORTANT** : Kubernetes has been deprecating API(s) which will be removed and no longer available in 1.22 and in the Openshift version 4.9. Note that your project will be unable to use them on OCP 4.9/K8s 1.22 and then, it is strongly recommended to check [Deprecated API Migration Guide from v1.22](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22) and ensure that your projects have them migrated and are not using any deprecated API.
To prevent workflow issues, its users will need to have installed in their OCP cluster a version of your operator compatible with 4.9 before they try to upgrade their cluster from any previous version to 4.9 or higher. However, If you still need to publish the operator bundles with any of these API(s) for use on earlier k8s/OCP versions, ensure that the operator bundle is configured accordingly:
Use the olm.openShiftMaxVersion property in the CSV to prevent the user from upgrading their OCP cluster before upgrading the installed operator version to any distribution which is compatible with:
```yaml
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
# Prevent cluster upgrades to OpenShift Version 4.9 when this
# bundle is installed on the cluster
"olm.properties": '[{"type": "olm.maxOpenShiftVersion", "value": "4.8"}]'
```
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
test-lemon:
name: "lemon / Deploy from scratch"
needs: pr-check
if: needs.pr-check.outputs.opp_test_ready == '1'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Operator test
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
run: |
echo "lemon operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
bash <(curl -sL $OPP_SCRIPT_URL) lemon "operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
test-orange-latest:
name: "orange / Deploy k8s latest"
needs: pr-check
if: needs.pr-check.outputs.opp_test_ready == '1' && needs.pr-check.outputs.opp_op_delete == '0'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Operator test
env:
OPP_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
run: |
echo "orange operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
bash <(curl -sL $OPP_SCRIPT_URL) orange "operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
test-summary:
name: "Summary"
needs: [ pr-check, test-kiwi, test-lemon, test-orange-latest]
if: always()
runs-on: ubuntu-latest
steps:
- name: PR
if: needs.pr-check.outputs.opp_test_ready == '1'
continue-on-error: true
run: |
echo "OP_PR=${{ github.event.pull_request.number }}"
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/