-
Notifications
You must be signed in to change notification settings - Fork 586
414 lines (371 loc) · 23 KB
/
operator_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
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_SCRIPT_CLEANUP_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-disk-cleanup-on-startup.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_REPO_NAME: "community-operators"
OPP_THIS_REPO_ORG: "k8s-operatorhub"
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_tmp"
OPP_MIRROR_INDEX_MULTIARCH_BASE: "quay.io/operator-framework/opm"
OPP_MULTIARCH_SUPPORTED_VERSIONS: "latest"
OPP_MIRROR_INDEX_MULTIARCH_POSTFIX: "s"
IIB_INPUT_REGISTRY_USER: "framework_automation"
OPP_PROD: 0
OPP_DRY_RUN: 0
# TODO handle config
OPP_PACKAGEMANIFEST_DISABLED: "1"
KIND_VERSION: "v0.20.0"
KIND_KUBE_VERSION_LATEST: "v1.27.2"
OPP_PRODUCTION_TYPE: "k8s"
OPP_REVIEWERS_ENABLED: 1
OPP_FORCE_DEPLOY_ON_K8S_OPENSHIFT_VERSION: 4.10
# ARTEFACT_PATH: "/tmp/operator-test" #hardcoded for now
IIB_INPUT_REGISTRY_TOKEN: ${{ secrets.IIB_INPUT_REGISTRY_TOKEN }}
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@v4
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 traffic light (result)
id: op-traffic-light-result
if: always() && (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1' )
run: |
if [ -f /tmp/pr_rebase.txt ] ; then
echo "git_rebase_conflict=1" >> $GITHUB_OUTPUT
MARKER="===EOF-${RANDOM}==="
echo "git_rebase_conflict_comment<<${MARKER}" >> $GITHUB_OUTPUT
cat /tmp/pr_rebase.txt >> $GITHUB_OUTPUT
echo "${MARKER}" >> $GITHUB_OUTPUT
else
echo "git_rebase_conflict=0" >> $GITHUB_OUTPUT
echo "git_rebase_conflict_comment=" >> $GITHUB_OUTPUT
fi
- name: Operator traffic light (comment)
id: op-traffic-light-comment
if: always() && steps.op-traffic-light-result.outputs.git_rebase_conflict == '1'
uses: mshick/add-pr-comment@v1
with:
message: |
Dear @${{ github.event.pull_request.user.login }},
Your forked procject is not rebased
To fix this issue please rebase or execute following commands:
```
${{ steps.op-traffic-light-result.outputs.git_rebase_conflict_comment }}
```
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: Operator info
id: op-info
if: (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1') && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
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"
[ "$OPP_PACKAGEMANIFEST_DISABLED" = '1' ] && ANSIBLE_ARGS="-e manifest_format_disabled=true" || ANSIBLE_ARGS="$ANSIBLE_ARGS --e manifest_format_disabled=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 strict_k8s_bundles=true -e production_registry_namespace=$OPP_RELEASE_BUNDLE_REGISTRY/$OPP_RELEASE_BUNDLE_ORGANIZATION $ANSIBLE_ARGS
- name: Operator info (result)
id: op-info-result
if: always() && (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1' ) && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
run: |
echo "opp_check_err_k8s_bundles=0" >> $GITHUB_OUTPUT
echo "opp_check_err_k8s_bundles_value=" >> $GITHUB_OUTPUT
echo "opp_check_err_package_manifest=" >> $GITHUB_OUTPUT
[ -f /tmp/operator-test/op_failed_k8s_bundles.yaml ] && echo "opp_check_err_k8s_bundles=1" >> $GITHUB_OUTPUT || true
[ -f /tmp/operator-test/op_failed_k8s_bundles.yaml ] && echo "opp_check_err_k8s_bundles_value=$(cat /tmp/operator-test/op_failed_k8s_bundles.yaml | yq -r '.operators | @csv' | tr -d '"')" >> $GITHUB_OUTPUT || true
[ -f /tmp/operator-test/format_failed ] && echo "opp_check_err_package_manifest=1" >> $GITHUB_OUTPUT || true
- name: Operator info (packagemanifest format failed)
id: op-info-comment-format
if: always() && steps.op-info-result.outputs.opp_check_err_package_manifest == '1' && (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1' ) && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
uses: mshick/add-pr-comment@v1
with:
message: |
Dear @${{ github.event.pull_request.user.login }},
your operator is in package manifest format. This format is not supported anymore. Please convert it to bundle format. [More info](https://docs.openshift.com/container-platform/4.12/operators/operator_sdk/osdk-pkgman-to-bundle.html)
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: Operator info (comment)
id: op-info-comment
if: always() && steps.op-info-result.outputs.opp_check_err_k8s_bundles == '1' && (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1' ) && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
uses: mshick/add-pr-comment@v1
with:
message: |
Dear @${{ github.event.pull_request.user.login }},
There are some operators version that are using **deprecated api** and kubernetes max versions (`operatorhub.io/ui-metadata-max-k8s-version`) is **NOT** set correctly under annotation field in CSV file.
Affected versions : `${{ steps.op-info-result.outputs.opp_check_err_k8s_bundles_value }}`
More info in 'Kubernetes max version in CSV' section [here](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/operator-ci-yaml/#kubernetes-max-version-in-csv).
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- name: Upload operator_info
uses: actions/upload-artifact@v2
if: (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1') && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
with:
name: operator_info
path: "/tmp/operator-test/op_info.yaml"
- name: Upload converted operators
if: (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1') && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
uses: actions/upload-artifact@v2
with:
name: operators_converted
path: "/tmp/operator-test/operators"
- shell: bash
if: (steps.op-traffic-light.outputs.opp_op_delete == '0' || steps.op-traffic-light.outputs.opp_is_new_operatror == '1' || steps.op-traffic-light.outputs.opp_recreate == '1') && (steps.op-traffic-light.outputs.opp_ci_yaml_only == '0')
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_recreate: "${{ steps.op-traffic-light.outputs.opp_recreate }}"
opp_is_new_operatror: "${{ steps.op-traffic-light.outputs.opp_is_new_operatror }}"
opp_auto_packagemanifest_cluster_version_label: "${{ steps.op-traffic-light.outputs.opp_auto_packagemanifest_cluster_version_label }}"
opp_installation_skipped: "${{ steps.op-traffic-light.outputs.opp_installation_skipped }}"
kind_kube_version: "${{ steps.op-traffic-light.outputs.kind_kube_version }}"
test-kiwi:
name: "kiwi / Full operator test"
needs: pr-check
if: needs.pr-check.outputs.opp_test_ready == '1' && (needs.pr-check.outputs.opp_op_delete == '0' || needs.pr-check.outputs.opp_is_new_operatror == '1' || needs.pr-check.outputs.opp_recreate == '1' ) && needs.pr-check.outputs.opp_ci_yaml_only == '0'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
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
id: 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 }}"
OPP_INSTALLATION_SKIP: "${{ needs.pr-check.outputs.opp_installation_skipped }}"
KIND_KUBE_VERSION: "${{ needs.pr-check.outputs.kind_kube_version }}"
run: |
bash <(curl -sL $OPP_SCRIPT_CLEANUP_URL)
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 }}" || { RC=$?; echo $RC; true; }
echo $RC
if [[ $RC -gt 0 ]];then
OPP_BUNDLE_VALIDATE_FILE_IN_CONTAINER=/tmp/operator-test/operator-files/operator_sdk_bundle_validate_warnings_and_errors.txt
OPP_BUNDLE_VALIDATE_FILE=/tmp/operator_sdk_bundle_validate_warnings_and_errors.txt
docker cp op-test:$OPP_BUNDLE_VALIDATE_FILE_IN_CONTAINER $OPP_BUNDLE_VALIDATE_FILE || true
OPP_BUNDLE_VALIDATE_FILE_IN_CONTAINER=/tmp/operator-test/operator-files/operator_sdk_bundle_validate_info.txt
OPP_BUNDLE_VALIDATE_FILE=/tmp/operator_sdk_bundle_validate_info.txt
docker cp op-test:$OPP_BUNDLE_VALIDATE_FILE_IN_CONTAINER $OPP_BUNDLE_VALIDATE_FILE || true
exit $RC
fi
- name: "Parse operator_sdk_bundle_validate_warnings_and_errors"
id: op-kiwi-test-err-bundle-validate
if: always()
run: |
echo "operator_sdk_version=na" >> $GITHUB_OUTPUT
echo "operator_sdk_args=na" >> $GITHUB_OUTPUT
OPP_BUNDLE_VALIDATE_FILE=/tmp/operator_sdk_bundle_validate_warnings_and_errors.txt
if [ -f $OPP_BUNDLE_VALIDATE_FILE ] ;then
delimiter="===EOF-${RANDOM}==="
echo "opp_check_err_bundle_validate<<${delimiter}" >> $GITHUB_OUTPUT
cat "$OPP_BUNDLE_VALIDATE_FILE" >> $GITHUB_OUTPUT
echo "${delimiter}" >> $GITHUB_OUTPUT
else
echo "opp_check_err_bundle_validate=" >> $GITHUB_OUTPUT
fi
OPP_BUNDLE_VALIDATE_INFO_FILE=/tmp/operator_sdk_bundle_validate_info.txt
if [ -f $OPP_BUNDLE_VALIDATE_INFO_FILE ] ;then
echo "operator_sdk_version=$(sed '1q;d' $OPP_BUNDLE_VALIDATE_INFO_FILE)" >> $GITHUB_OUTPUT
echo "operator_sdk_args=$(sed '2q;d' $OPP_BUNDLE_VALIDATE_INFO_FILE)" >> $GITHUB_OUTPUT
fi
- name: "Comment operator_sdk_bundle_validate_warnings_and_errors if exists"
if: always() && steps.op-kiwi-test-err-bundle-validate.outputs.opp_check_err_bundle_validate != ''
uses: mshick/add-pr-comment@v1
with:
message: |
Dear @${{ github.event.pull_request.user.login }},
Some errors and/or warnings were found while doing the check of your operator (`${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}`) against the entire suite of validators for Operator Framework with [Operator-SDK](https://github.com/operator-framework/operator-sdk) version `${{ steps.op-kiwi-test-err-bundle-validate.outputs.operator_sdk_version }}` and the command `$ operator-sdk bundle validate <bundle-path> ${{ steps.op-kiwi-test-err-bundle-validate.outputs.operator_sdk_args }}`.
**Errors (:bug:) must be fixed while warnings (:warning:) are informative, and fixing them might improve the quality of your solution.**
${{ steps.op-kiwi-test-err-bundle-validate.outputs.opp_check_err_bundle_validate }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true
- 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 "opp_check_err_maxOpenShiftVersion=$ERR_LINES" >> $GITHUB_OUTPUT
- 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' && (needs.pr-check.outputs.opp_op_delete == '0' || needs.pr-check.outputs.opp_is_new_operatror == '1' || needs.pr-check.outputs.opp_recreate == '1') && needs.pr-check.outputs.opp_ci_yaml_only == '0'
runs-on: ubuntu-latest
strategy:
matrix:
index-tag: ['latest']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
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 }}"
OPERATOR_INDEX_TAG: ${{ matrix.index-tag }}
KIND_KUBE_VERSION: "${{ needs.pr-check.outputs.kind_kube_version }}"
run: |
bash <(curl -sL $OPP_SCRIPT_CLEANUP_URL)
echo "lemon_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
bash <(curl -sL $OPP_SCRIPT_URL) lemon_${OPERATOR_INDEX_TAG} "operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
test-orange-latest:
name: "orange / Deploy k8s"
needs: pr-check
if: needs.pr-check.outputs.opp_test_ready == '1' && (needs.pr-check.outputs.opp_op_delete == '0' || needs.pr-check.outputs.opp_is_new_operatror == '1' || needs.pr-check.outputs.opp_recreate == '1' ) && needs.pr-check.outputs.opp_ci_yaml_only == '0'
runs-on: ubuntu-latest
strategy:
matrix:
index-tag: ['latest']
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
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 }}"
OPP_MIRROR_INDEX_ENABLED: 1
OPP_IIB_INSTALL: 0
IIB_INPUT_REGISTRY_TOKEN: ${{ secrets.IIB_INPUT_REGISTRY_TOKEN }}
OPERATOR_INDEX_TAG: ${{ matrix.index-tag }}
OPP_INSTALLATION_SKIP: "${{ needs.pr-check.outputs.opp_installation_skipped }}"
KIND_KUBE_VERSION: "${{ needs.pr-check.outputs.kind_kube_version }}"
run: |
bash <(curl -sL $OPP_SCRIPT_CLEANUP_URL)
echo "orange_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }}"
bash <(curl -sL $OPP_SCRIPT_URL) orange_${OPERATOR_INDEX_TAG} "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/
- name: "Setting package-validated label"
if: needs.pr-check.outputs.opp_ci_yaml_only == '1'
uses: actions/github-script@v6
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['package-validated']
})