This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 6ee3e4ec5f43beca1f3822375ab5fb58e0d9dd81 Author: Pasquale Congiusti <[email protected]> AuthorDate: Tue Jun 18 15:40:40 2024 +0200 chore(ci): simplify github actions execution --- .github/actions/e2e-builder/action.yml | 61 ----- .github/actions/e2e-install-olm/action.yml | 29 -- .github/actions/e2e-install-upgrade/action.yml | 29 -- .github/actions/e2e-install/action.yml | 41 --- .github/actions/e2e-knative-yaks/action.yml | 60 ----- .github/actions/e2e-knative/action.yml | 55 ---- .github/actions/e2e-native/action.yml | 47 ---- .github/actions/e2e-telemetry/action.yml | 54 ---- .github/actions/kamel-cleanup/action.yaml | 76 ------ .../actions/kamel-cleanup/clean-operator-groups.sh | 68 ----- .../kamel-cleanup/clean-orphan-resources.sh | 57 ---- .../kamel-cleanup/clean-telemetry-resources.sh | 44 ---- .github/actions/kamel-cleanup/cleanup-knative.sh | 74 ------ .github/actions/kamel-cleanup/cleanup.sh | 108 -------- .github/actions/kamel-cleanup/reset-proxy.sh | 56 ---- .../kamel-cleanup/uninstall-global-operator.sh | 118 --------- .../actions/kamel-install-cluster-setup/action.yml | 40 --- .../install-cluster-setup.sh | 68 ----- .../kamel-install-global-operator/action.yml | 64 ----- .../install-global-operator.sh | 251 ------------------ .github/actions/kamel-preflight-test/action.yml | 67 ----- .../actions/kamel-preflight-test/preflight-test.sh | 293 --------------------- .../actions/kamel-report-problematic/action.yml | 35 --- .../kamel-report-problematic/report-problematic.sh | 89 ------- .github/workflows/builder.yml | 16 -- .github/workflows/common.yml | 19 -- .github/workflows/install.yml | 18 -- .github/workflows/knative.yml | 16 -- .github/workflows/native.yml | 16 -- .github/workflows/telemetry.yml | 16 -- 30 files changed, 1985 deletions(-) diff --git a/.github/actions/e2e-builder/action.yml b/.github/actions/e2e-builder/action.yml index 919a8c3f1..1b96084cd 100644 --- a/.github/actions/e2e-builder/action.yml +++ b/.github/actions/e2e-builder/action.yml @@ -44,20 +44,6 @@ runs: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: build-kamel name: Build Kamel uses: ./.github/actions/kamel-build @@ -71,44 +57,6 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: install-kamel-cluster-setup - name: Install Kamel Cluster Setup - uses: ./.github/actions/kamel-install-cluster-setup - with: - kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: install-global-operator - name: "Install Global Operator" - if: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - uses: ./.github/actions/kamel-install-global-operator - with: - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: global/builder - - id: run-it name: Run IT shell: bash @@ -126,12 +74,3 @@ runs: -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-install-olm/action.yml b/.github/actions/e2e-install-olm/action.yml index a302a480e..40b0b199c 100644 --- a/.github/actions/e2e-install-olm/action.yml +++ b/.github/actions/e2e-install-olm/action.yml @@ -42,20 +42,6 @@ runs: cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} require-olm: true - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: released-kamel-cli name: Get Released Kamel CLI shell: bash @@ -95,12 +81,6 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: namespace/upgrade - - name: Run IT shell: bash run: | @@ -114,12 +94,3 @@ runs: -s "${{ steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-install-upgrade/action.yml b/.github/actions/e2e-install-upgrade/action.yml index ec7610b0e..760986d20 100644 --- a/.github/actions/e2e-install-upgrade/action.yml +++ b/.github/actions/e2e-install-upgrade/action.yml @@ -42,20 +42,6 @@ runs: cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} require-olm: true - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: released-kamel-cli name: Get Released Kamel CLI shell: bash @@ -95,12 +81,6 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: namespace/upgrade - - name: Run IT shell: bash run: | @@ -114,12 +94,3 @@ runs: -s "${{ steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-install/action.yml b/.github/actions/e2e-install/action.yml index 68fee7459..d54913d3e 100644 --- a/.github/actions/e2e-install/action.yml +++ b/.github/actions/e2e-install/action.yml @@ -41,20 +41,6 @@ runs: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: build-kamel name: Build Kamel uses: ./.github/actions/kamel-build @@ -74,24 +60,6 @@ runs: with: kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: namespace/install - - id: run-it name: Run IT shell: bash @@ -106,12 +74,3 @@ runs: -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-knative-yaks/action.yml b/.github/actions/e2e-knative-yaks/action.yml index 50281fe48..4e0936696 100644 --- a/.github/actions/e2e-knative-yaks/action.yml +++ b/.github/actions/e2e-knative-yaks/action.yml @@ -41,20 +41,6 @@ runs: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - name: Install Knative uses: ./.github/actions/kamel-install-knative @@ -71,49 +57,12 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: install-kamel-cluster-setup - name: Install Kamel Cluster Setup - uses: ./.github/actions/kamel-install-cluster-setup - with: - kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: install-global-operator - name: "Install Global Operator" - uses: ./.github/actions/kamel-install-global-operator - with: - global-operator-namespace: default - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - name: Install YAKS uses: ./.github/actions/kamel-install-yaks with: image-name: "docker.io/citrusframework/yaks" version: 0.19.1 - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: yaks/common - - id: run-it name: Run IT shell: bash @@ -135,12 +84,3 @@ runs: shell: bash run: | yaks report - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-knative/action.yml b/.github/actions/e2e-knative/action.yml index f445d51bd..87210ef5a 100644 --- a/.github/actions/e2e-knative/action.yml +++ b/.github/actions/e2e-knative/action.yml @@ -41,20 +41,6 @@ runs: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: build-kamel name: Build Kamel uses: ./.github/actions/kamel-build @@ -77,38 +63,6 @@ runs: with: kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: install-global-operator - name: "Install Global Operator" - if: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - uses: ./.github/actions/kamel-install-global-operator - with: - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: global/knative - - id: run-it name: Run IT shell: bash @@ -124,12 +78,3 @@ runs: -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-native/action.yml b/.github/actions/e2e-native/action.yml index aed604915..6ee19a0a8 100644 --- a/.github/actions/e2e-native/action.yml +++ b/.github/actions/e2e-native/action.yml @@ -41,20 +41,6 @@ runs: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - - id: build-kamel name: Build Kamel uses: ./.github/actions/kamel-build @@ -68,30 +54,6 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: install-kamel-cluster-setup - name: Install Kamel Cluster Setup - uses: ./.github/actions/kamel-install-cluster-setup - with: - kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: report-problematic - name: List Tests Marked As Problematic - uses: ./.github/actions/kamel-report-problematic - with: - test-suite: namespace/native - - id: run-it name: Run IT shell: bash @@ -106,12 +68,3 @@ runs: -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -q "${{ env.CAMEL_K_LOG_LEVEL }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/e2e-telemetry/action.yml b/.github/actions/e2e-telemetry/action.yml index 14f2f1bcb..1504f7b9a 100644 --- a/.github/actions/e2e-telemetry/action.yml +++ b/.github/actions/e2e-telemetry/action.yml @@ -40,19 +40,6 @@ runs: with: cluster-config-data: ${{ inputs.cluster-config-data }} cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }} - # - # Try and ensure the cluster is in a vanilla state before - # starting in on an installation - # - - id: pre-clean-cluster - name: Pre Clean Cluster - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - id: build-kamel name: Build Kamel @@ -67,38 +54,6 @@ runs: catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - - id: install-kamel-cluster-setup - name: Install Kamel Cluster Setup - uses: ./.github/actions/kamel-install-cluster-setup - with: - kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }} - - - id: preflight-test - name: Preflight Check Test - uses: ./.github/actions/kamel-preflight-test - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - - id: install-global-operator - name: "Install Global Operator" - if: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - uses: ./.github/actions/kamel-install-global-operator - with: - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }} - image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }} - image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }} - image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }} - - name: Install OTLP Collector uses: ./.github/actions/kamel-install-otlp-collector with: @@ -126,12 +81,3 @@ runs: -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure }}" \ -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \ -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" - - - name: Cleanup - uses: ./.github/actions/kamel-cleanup - if: ${{ always() }} - with: - catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }} - catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }} - image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }} - global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }} diff --git a/.github/actions/kamel-cleanup/action.yaml b/.github/actions/kamel-cleanup/action.yaml deleted file mode 100644 index 3a937787f..000000000 --- a/.github/actions/kamel-cleanup/action.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -name: kamel-cleanup -description: 'Cleans up the target cluster, removing any e2e test resources' - -inputs: - catalog-source-name: - description: "Name of the catalog source for the build bundle image" - required: true - catalog-source-namespace: - description: "Namespace of the catalog source for the build bundle image" - required: true - image-namespace: - description: "Installed location of the images if resident on the cluster (only applies to clusters with partnered registries)" - required: false - global-operator-namespace: - description: "The namespace to uninstall the global operator from" - required: true - -runs: - using: "composite" - steps: - - id: uninstall-global-operator - name: Execute Operator Uninstall - shell: bash - run: | - ./.github/actions/kamel-cleanup/uninstall-global-operator.sh \ - -c "${{ inputs.catalog-source-namespace }}" \ - -g "${{ inputs.global-operator-namespace }}" - - - id: remove-orphan-resources - name: Remove Orphaned Resources - shell: bash - if: ${{ always() }} - run: | - ./.github/actions/kamel-cleanup/clean-orphan-resources.sh - - - id: remove-leftover-operatorgroups - name: Remove Leftover OperatorGroups - shell: bash - if: ${{ always() }} - run: | - ./.github/actions/kamel-cleanup/clean-operator-groups.sh - - - id: remove-telemetry-resources - name: Remove Installed Telemetry Resources - shell: bash - if: ${{ always() }} - run: | - ./.github/actions/kamel-cleanup/clean-telemetry-resources.sh - - - id: remove-installed-kamel - name: Remove Installed Kamel - shell: bash - if: ${{ always() }} - run: | - ./.github/actions/kamel-cleanup/cleanup.sh \ - -b "${{ inputs.catalog-source-name }}" \ - -c "${{ inputs.catalog-source-namespace }}" \ - -i "${{ inputs.image-namespace }}" \ - -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}" diff --git a/.github/actions/kamel-cleanup/clean-operator-groups.sh b/.github/actions/kamel-cleanup/clean-operator-groups.sh deleted file mode 100755 index a8ac09cd3..000000000 --- a/.github/actions/kamel-cleanup/clean-operator-groups.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -# -# Remove any operator groups that might be left over from -# previous failed tests and conflict with operator installation -# - -set +e - -# -# Find all the namespaces containing the operator groups -# that may exist in other test-* namespaces -# -namespaces=$(kubectl get operatorgroups --all-namespaces | grep -v NAMESPACE | awk '{print $1}' | grep "test-") -if [ -z "${namespaces}" ]; then - echo "No test operatorgroups installed" - exit 0 -fi - -echo "Test namespaces with operatorgroups: ${namespaces}" - -# -# Loop through the namespaces -# -for ns in ${namespaces} -do - echo "Examining namespace ${ns}" - - # - # Find all the resources of the type in the namespace - # - ogs=$(kubectl get operatorgroups -n "${ns}" | grep -v NAME | awk '{print $1}') - echo "Identified operatorgroups: ${ogs}" - - # - # Loop through the groups - # - for og in ${ogs} - do - echo "Removing operatorgroup / ${og} from namespace ${ns} ... " - kubectl delete operatorgroup ${og} -n "${ns}" - done - -done - -ogs=$(kubectl get operatorgroups --all-namespaces) -if [ -z "${ogs}" ]; then - echo "No operatorgroups remaining" -else - echo "Remaining namespaces with operatorgroups: \"${namespaces}\"" -fi diff --git a/.github/actions/kamel-cleanup/clean-orphan-resources.sh b/.github/actions/kamel-cleanup/clean-orphan-resources.sh deleted file mode 100755 index f217096a1..000000000 --- a/.github/actions/kamel-cleanup/clean-orphan-resources.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - - -set +e - -resourcetypes="integrations integrationkits integrationplatforms integrationprofiles camelcatalogs kamelets builds pipes kameletbindings" - -# -# Loop through the resource types -# Cannot loop through namespace as some maybe have already been deleted so not 'visible' -# -for resourcetype in ${resourcetypes} -do - echo "Cleaning ${resourcetype} ..." - # - # Find all the namespaces containing the resource type - # - namespaces=$(kubectl get ${resourcetype} --all-namespaces | grep -v NAMESPACE | awk '{print $1}' | sort | uniq) - - # - # Loop through the namespaces - # - for ns in ${namespaces} - do - actives=$(kubectl get ns ${ns} &> /dev/null | grep Active) - if [ $? == 0 ]; then - # this namespace is still Active so do not remove resources - continue - fi - - printf "Removing ${resourcetype} from namespace ${ns} ... " - ok=$(kubectl delete ${resourcetype} -n "${ns}" --all) - if [ $? == 0 ]; then - printf "OK\n" - else - printf "Error\n" - fi - done - -done diff --git a/.github/actions/kamel-cleanup/clean-telemetry-resources.sh b/.github/actions/kamel-cleanup/clean-telemetry-resources.sh deleted file mode 100755 index facc05dd7..000000000 --- a/.github/actions/kamel-cleanup/clean-telemetry-resources.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - - -# -# Remove any telemetry groups resources that might have been deployed for tests. -# All the telemetry resources are deployed in otlp namespace. -# - -set +e - -# -# Find if the namespace containing telemetry resources exists -# -namespace_otlp=$(kubectl --ignore-not-found=true get namespaces otlp) -if [ -z "${namespace_otlp}" ]; then - echo "No telemetry resource installed" - exit 0 -fi - -echo "Telemetry namespace exists: ${namespace_otlp}" - -# -# Delete telemetry resources namespace -# -kubectl delete --now --timeout=600s namespace ${namespace_otlp} 1> /dev/null - -echo "Telemetry resources deleted" \ No newline at end of file diff --git a/.github/actions/kamel-cleanup/cleanup-knative.sh b/.github/actions/kamel-cleanup/cleanup-knative.sh deleted file mode 100755 index 660179a09..000000000 --- a/.github/actions/kamel-cleanup/cleanup-knative.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Perform a cleanup of knative installation -# -#### -set +e - -cleanup_resources() { - local kind="${1}" - local needle="${2}" - - # Stops "Resource not found message" and exit code to 0 - local result=$(kubectl --ignore-not-found=true get ${kind} | grep ${needle}) - if [ $? == 0 ]; then - names=$(echo "${result}" | awk '{print $1}') - for r in ${names} - do - # Timeout after 10 minutes - kubectl delete --now --timeout=600s ${kind} ${r} 1> /dev/null - done - fi - - echo "Done" -} - -# Remove any namespaces -echo -n "Removing testing knative namespaces ... " -cleanup_resources ns 'knative-eventing\|knative-serving\|kourier-system' - -# Mutating webhooks -echo -n "Removing testing knative mutating webhooks ... " -cleanup_resources MutatingWebhookConfiguration 'knative.dev' - -# Validating webhooks -echo -n "Removing testing knative validating webhooks ... " -cleanup_resources ValidatingWebhookConfiguration 'knative.dev' - -# Cluster Role Bindings -echo -n "Removing testing knative cluster role bindings ... " -cleanup_resources clusterrolebindings 'kourier\|knative\|imc' - -# Cluster Roles -echo -n "Removing testing knative cluster roles ... " -cleanup_resources clusterroles 'knative\|imc' - -# CRDS -CRDS=$(kubectl --ignore-not-found=true get crds | grep knative | awk '{print $1}') -if [ -n "${CRDS}" ]; then - for crd in ${CRDS} - do - echo -n "Removing ${crd} CRD ... " - cleanup_resources crds "${crd}" - done -fi -set -e diff --git a/.github/actions/kamel-cleanup/cleanup.sh b/.github/actions/kamel-cleanup/cleanup.sh deleted file mode 100755 index d38479423..000000000 --- a/.github/actions/kamel-cleanup/cleanup.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Perform a cleanup of the test suite -# -#### - -set -e - -while getopts ":b:c:i:x:" opt; do - case "${opt}" in - b) - BUILD_CATALOG_SOURCE_NAME=${OPTARG} - ;; - c) - BUILD_CATALOG_SOURCE_NAMESPACE=${OPTARG} - ;; - i) - IMAGE_NAMESPACE=${OPTARG} - ;; - x) - SAVE_NAMESPACES=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -# -# Reset the proxy to default if using an OLM -# which would require a catalogsource -# -if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then - ./.github/actions/kamel-cleanup/reset-proxy.sh -fi - -if [ -n "${IMAGE_NAMESPACE}" ]; then - echo -n "Removing compiled image streams ... " - imgstreams="camel-k camel-k-bundle camel-k-iib" - set +e - for cis in ${imgstreams} - do - if kubectl get is ${cis} -n ${IMAGE_NAMESPACE} &> /dev/null - then - kubectl delete is ${cis} -n ${IMAGE_NAMESPACE} - fi - done - set -e - echo "Done" -fi - -# -# Remove Catalog Source -# -if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then - set +e - echo -n "Removing testing catalogsource ... " - kubectl delete catalogsource ${BUILD_CATALOG_SOURCE_NAME} -n ${BUILD_CATALOG_SOURCE_NAMESPACE} - if [ $? == 0 ]; then - echo "Done" - else - echo "Warning: Catalog Source ${BUILD_CATALOG_SOURCE_NAME} not found in ${BUILD_CATALOG_SOURCE_NAMESPACE}" - fi - - set -e -fi - -# -# Remove installed kamel -# -set +e -if command -v kamel &> /dev/null -then - kamel uninstall --olm=false --all --skip-crd=false -fi - -# Ensure the CRDs are removed -kubectl get crds | grep camel | awk '{print $1}' | xargs kubectl delete crd &> /dev/null - -# -# Remove Knative resources -# -./.github/actions/kamel-cleanup/cleanup-knative.sh diff --git a/.github/actions/kamel-cleanup/reset-proxy.sh b/.github/actions/kamel-cleanup/reset-proxy.sh deleted file mode 100755 index 741a92e18..000000000 --- a/.github/actions/kamel-cleanup/reset-proxy.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -set +e - -kubectl get Proxy cluster >& /dev/null -if [ $? != 0 ]; then - echo "Cluster does not have proxy called 'cluster'. Nothing to do." - exit 0 -fi - -# -# Remove values altogther -# -PATCH=$(mktemp /tmp/proxy-patch.XXXXXXXX) -cat >${PATCH} <<EOF -[ -{ - "op": "replace", - "path": "/spec", - "value": {} -}, -{ - "op": "replace", - "path": "/status", - "value": {} -} -] -EOF - -kubectl patch --type='json' Proxy cluster --patch-file "${PATCH}" - -if [ $? != 0 ]; then - echo "Error: Failed to reset the Proxy" - exit 1 -fi - -rm -f "${PATCH}" - -set -e diff --git a/.github/actions/kamel-cleanup/uninstall-global-operator.sh b/.github/actions/kamel-cleanup/uninstall-global-operator.sh deleted file mode 100755 index 3d30ec10b..000000000 --- a/.github/actions/kamel-cleanup/uninstall-global-operator.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Execute an uninstall of a global operator -# -#### - -set +e - -while getopts ":c:g:" opt; do - case "${opt}" in - c) - BUILD_CATALOG_SOURCE_NAMESPACE=${OPTARG} - ;; - g) - GLOBAL_OPERATOR_NAMESPACE=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${GLOBAL_OPERATOR_NAMESPACE}" ]; then - # Not defined so no need to go any further - exit 0 -fi - -# -# Determine if olm was used based on catalog source definition -# -has_olm="false" -if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then - has_olm="true" -fi - -# -# Check the global namespace -# -kubectl get ns ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null -if [ $? != 0 ]; then - echo "Info: The ${GLOBAL_OPERATOR_NAMESPACE} namespace does not exist. Nothing to do." - exit 0 -fi - -kubectl get deploy camel-k-operator -n ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null -if [ $? != 0 ]; then - echo "Info: The operator is not installed in the global operator namespace (${GLOBAL_OPERATOR_NAMESPACE}). Nothing to do." - exit 0 -fi - -# -# Uninstall the operator -# (ignore errors if nothing is installed) -# -set +e - -if [ "${has_olm}" == "true" ]; then - # Delete subscription if present - kubectl get subs -n ${GLOBAL_OPERATOR_NAMESPACE} | \ - grep camel-k | awk '{print $1}' | \ - xargs -I '{}' kubectl delete subs '{}' -n ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null - - # Delete CSV if present - kubectl get csv -n ${GLOBAL_OPERATOR_NAMESPACE} | \ - grep camel-k | awk '{print $1}' | \ - xargs -I '{}' kubectl delete csv '{}' -n ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null -else - kubectl get deploy -n ${GLOBAL_OPERATOR_NAMESPACE} | \ - grep camel-k-operator | awk '{print $1}' | \ - xargs -I '{}' kubectl delete deploy '{}' -n ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null -fi - -sleep 3 - -# -# Wait for the operator to be removed -# -timeout=180 -i=1 -command="kubectl get pods -n ${GLOBAL_OPERATOR_NAMESPACE} 2> /dev/null | grep camel-k-operator &> /dev/null" - -while eval "${command}" -do - ((i++)) - if [ "${i}" -gt "${timeout}" ]; then - echo "Warning: kamel operator not successfully uninstalled, aborting due to ${timeout}s timeout" - exit 0 - fi - - sleep 1 -done - -echo "Camel K operator uninstalled." diff --git a/.github/actions/kamel-install-cluster-setup/action.yml b/.github/actions/kamel-install-cluster-setup/action.yml deleted file mode 100644 index cfdecd6a4..000000000 --- a/.github/actions/kamel-install-cluster-setup/action.yml +++ /dev/null @@ -1,40 +0,0 @@ -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -name: kamel-install-cluster-setup -description: 'Execute kamel to install the cluster-level artifacts' - -inputs: - kube-admin-user-ctx: - description: "The administration user context of the cluster" - required: true - -runs: - using: "composite" - steps: - - id: execute-kamel - name: Install Camel K Cluster Resources - shell: bash - run: | - ./.github/actions/kamel-install-cluster-setup/install-cluster-setup.sh \ - -a "${{ inputs.kube-admin-user-ctx }}" - - - id: post-execution - shell: bash - run: | - rm -f /tmp/config - export -n KUBECONFIG diff --git a/.github/actions/kamel-install-cluster-setup/install-cluster-setup.sh b/.github/actions/kamel-install-cluster-setup/install-cluster-setup.sh deleted file mode 100755 index 721cd0a35..000000000 --- a/.github/actions/kamel-install-cluster-setup/install-cluster-setup.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Install the kamel setup using the admin context -# -#### - -set -e - -while getopts ":a:" opt; do - case "${opt}" in - a) - KUBE_ADMIN_CTX=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${KUBE_ADMIN_CTX}" ]; then - echo "Error: kube-admin-user-ctx not defined" - exit 1 -fi - -# -# Get current context -# -ctx=$(kubectl config current-context) - -# -# Need to be admin so switch to the admin context -# -kubectl config use-context "${KUBE_ADMIN_CTX}" - -# -# Ensure built binary CRDs are always installed by turning off olm -# -kamel install --cluster-setup --olm=false - -# -# Change back to original context -# -kubectl config use-context "${ctx}" diff --git a/.github/actions/kamel-install-global-operator/action.yml b/.github/actions/kamel-install-global-operator/action.yml deleted file mode 100644 index e8b32288b..000000000 --- a/.github/actions/kamel-install-global-operator/action.yml +++ /dev/null @@ -1,64 +0,0 @@ -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -name: kamel-install-global-operator -description: 'Installs the camel-k as a global operator in the specified global namespace' - -inputs: - global-operator-namespace: - description: "The namespace to install the global operator" - required: true - catalog-source-name: - description: "The name of the bundle catalog (only installed in the cluster if OLM is used)" - required: false - catalog-source-namespace: - description: "The namespace of the bundle catalog (only installed in the cluster if OLM is used)" - required: false - image-namespace: - description: 'Namespace in which the image is stored' - required: true - image-registry-host: - description: 'Location of image registry host' - required: true - image-name: - description: 'Reference of the camel-k image' - required: true - image-registry-insecure: - description: "Whether the registry is insecure" - required: true - image-version: - description: "Reference of the camel-k image version" - required: true - -runs: - using: "composite" - - steps: - - id: install-global-operator - name: Execute Operator Install - shell: bash - run: | - ./.github/actions/kamel-install-global-operator/install-global-operator.sh \ - -b "${{ inputs.catalog-source-name }}" \ - -c "${{ inputs.catalog-source-namespace }}" \ - -g "${{ inputs.global-operator-namespace }}" \ - -i "${{ inputs.image-namespace }}" \ - -l "${{ inputs.image-registry-host }}" \ - -n "${{ inputs.image-name }}" \ - -q "${{ env.CAMEL_K_LOG_LEVEL }}" \ - -s "${{ inputs.image-registry-insecure }}" \ - -v "${{ inputs.image-version }}" diff --git a/.github/actions/kamel-install-global-operator/install-global-operator.sh b/.github/actions/kamel-install-global-operator/install-global-operator.sh deleted file mode 100755 index 7a8ebfc75..000000000 --- a/.github/actions/kamel-install-global-operator/install-global-operator.sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Execute an install of a global operator -# -#### - -set -e - -while getopts ":b:c:g:i:l:n:q:s:v:" opt; do - case "${opt}" in - b) - BUILD_CATALOG_SOURCE_NAME=${OPTARG} - ;; - c) - BUILD_CATALOG_SOURCE_NAMESPACE=${OPTARG} - ;; - g) - GLOBAL_OPERATOR_NAMESPACE=${OPTARG} - ;; - i) - IMAGE_NAMESPACE=${OPTARG} - ;; - l) - REGISTRY_PULL_HOST=${OPTARG} - ;; - n) - IMAGE_NAME=${OPTARG} - ;; - q) - LOG_LEVEL=${OPTARG} - ;; - s) - REGISTRY_INSECURE=${OPTARG} - ;; - v) - IMAGE_VERSION=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${IMAGE_NAME}" ]; then - echo "Error: local-image-name not defined" - exit 1 -fi - -if [ -z "${IMAGE_VERSION}" ]; then - echo "Error: local-image-version not defined" - exit 1 -fi - -if [ -z "${IMAGE_NAMESPACE}" ]; then - echo "Error: image-namespace not defined" - exit 1 -fi - -if [ -z "${REGISTRY_PULL_HOST}" ]; then - echo "Error: image-registry-pull-host not defined" - exit 1 -fi - -if [ -z "${REGISTRY_INSECURE}" ]; then - echo "Error: image-registry-insecure not defined" - exit 1 -fi - -if [ -z "${GLOBAL_OPERATOR_NAMESPACE}" ]; then - echo "Error: global-operator-namespace not defined" - exit 1 -fi - -# -# Check the global namespace -# -set +e -kubectl get ns ${GLOBAL_OPERATOR_NAMESPACE} &> /dev/null -if [ $? != 0 ]; then - echo "Error: The ${GLOBAL_OPERATOR_NAMESPACE} namespace does not exist" - exit 1 -fi - -# Cluster environment -export CUSTOM_IMAGE=${IMAGE_NAME} -export CUSTOM_VERSION=${IMAGE_VERSION} - -# -# If bundle has been built and installed then use it -# -has_olm="false" -if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then - # - # Check catalog source is actually available - # - timeout=5 - catalog_ready=0 - until [ ${catalog_ready} -eq 1 ] || [ ${timeout} -eq 0 ] - do - echo "Info: Awaiting catalog source to become ready" - let timeout=${timeout}-1 - - STATE=$(kubectl get catalogsource ${BUILD_CATALOG_SOURCE_NAME} \ - -n ${BUILD_CATALOG_SOURCE_NAMESPACE} -o=jsonpath='{.status.connectionState.lastObservedState}') - if [ "${STATE}" == "READY" ]; then - let catalog_ready=1 - echo "Info: Catalog source is ready" - continue - else - echo "Warning: catalog source status is not ready." - if [ ${timeout} -eq 0 ]; then - echo "Error: timeout while awaiting catalog source to start" - exit 1 - fi - fi - - sleep 1m - done - - export KAMEL_INSTALL_OLM_SOURCE=${BUILD_CATALOG_SOURCE_NAME} - export KAMEL_INSTALL_OLM_SOURCE_NAMESPACE=${BUILD_CATALOG_SOURCE_NAMESPACE} - export KAMEL_INSTALL_OLM_CHANNEL="${NEW_XY_CHANNEL}" - has_olm="true" -fi - -export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo) -export KAMEL_INSTALL_REGISTRY=${REGISTRY_PULL_HOST} -export KAMEL_INSTALL_REGISTRY_INSECURE=${REGISTRY_INSECURE} -export KAMEL_INSTALL_OPERATOR_IMAGE=${CUSTOM_IMAGE}:${CUSTOM_VERSION} - -# Will only have an effect if olm=false -# since, for OLM, the csv determines the policy. -# (see kamel-build-bundle/build-bundle-image.sh) -export KAMEL_INSTALL_OPERATOR_IMAGE_PULL_POLICY="Always" - -logLevelSwitch="" -if [ -n "${LOG_LEVEL}" ]; then - logLevelSwitch="--log-level ${LOG_LEVEL}" -fi - -# -# Install the operator -# -kamel install -n ${GLOBAL_OPERATOR_NAMESPACE} ${logLevelSwitch} --olm=${has_olm} --force --global -if [ $? != 0 ]; then - echo "Error: kamel install returned an error." - exit 1 -fi - -sleep 3 - -# -# Wait for the operator to be running -# -timeout=180 -i=1 -command="kubectl get pods -n ${GLOBAL_OPERATOR_NAMESPACE} 2> /dev/null | grep camel-k-operator | grep Running &> /dev/null" - -until eval "${command}" -do - ((i++)) - if [ "${i}" -gt "${timeout}" ]; then - echo "kamel operator not successfully installed, aborting due to ${timeout}s timeout" - exit 1 - fi - - sleep 1 -done - -echo "Camel K operator up and running" - -sleep 3 - -i=0 -while [ ${i} -lt 12 ] -do - camel_operator=$(kubectl get pods -n ${GLOBAL_OPERATOR_NAMESPACE} | grep camel-k-operator | awk '{print $1}') - echo "Camel K operator: ${camel_operator}" - - camel_op_version=$(kubectl logs ${camel_operator} -n ${GLOBAL_OPERATOR_NAMESPACE} | sed -n 's/.*"Camel K Operator Version: \(.*\)"}/\1/p') - echo "Camel K operator version: ${camel_op_version}" - - camel_op_commit=$(kubectl logs ${camel_operator} -n ${GLOBAL_OPERATOR_NAMESPACE} | sed -n 's/.*"Camel K Git Commit: \(.*\)"}/\1/p') - echo "Camel K operator commit: ${camel_op_commit}" - - if [ -n "${camel_op_version}" ] && [ -n "${camel_op_commit}" ]; then - break - fi - - echo "Cannot find camel-k operator version & commit information yet" - echo "Status of pods in ${GLOBAL_OPERATOR_NAMESPACE}:" - kubectl get pods -n ${GLOBAL_OPERATOR_NAMESPACE} - - sleep 10 - i=$[${i}+1] -done - -if [ -z "${camel_op_version}" ]; then - echo "Error: Failed to get camel-k operator version" - exit 1 -fi - -if [ -z "${camel_op_commit}" ]; then - echo "Error: Failed to get camel-k operator commit" - exit 1 -fi - -src_commit=$(git rev-parse HEAD) - -# -# Test whether the versions are the same -# -if [ "${camel_op_version}" != "${IMAGE_VERSION}" ]; then - echo "Global Install Operator: Failure - Installed operator version (${camel_op_version}) does not match expected version (${IMAGE_VERSION})" - exit 1 -fi - -# -# Test whether the commit ids are the same -# -if [ "${camel_op_commit}" != "${src_commit}" ]; then - echo "Global Install Operator: Failure - Installed operator commit id (${camel_op_commit}) does not match expected commit id (${src_commit})" - exit 1 -fi - -echo "Global Operator Install: Success" diff --git a/.github/actions/kamel-preflight-test/action.yml b/.github/actions/kamel-preflight-test/action.yml deleted file mode 100644 index 625849350..000000000 --- a/.github/actions/kamel-preflight-test/action.yml +++ /dev/null @@ -1,67 +0,0 @@ -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -name: kamel-preflight-test -description: 'Does a preflight-test to check the operator can be installed correctly' - -inputs: - catalog-source-name: - description: "The name of the bundle catalog (only installed in the cluster if OLM is used)" - required: false - catalog-source-namespace: - description: "The namespace of the bundle catalog (only installed in the cluster if OLM is used)" - required: false - image-namespace: - description: 'Namespace in which the image is stored' - required: true - image-registry-host: - description: 'Location of image registry host' - required: true - image-name: - description: 'Reference of the camel-k image' - required: true - image-registry-insecure: - description: "Whether the registry is insecure" - required: true - image-version: - description: "Reference of the camel-k image version" - required: true - -runs: - using: "composite" - - steps: - - id: proxy-reset - name: Ensure Proxy has been reset - shell: bash - run: | - if [ -n "${{ inputs.catalog-source-name }}" ]; then - ./.github/actions/kamel-cleanup/reset-proxy.sh - fi - - - id: preflight-test - name: Execute Preflight Test - shell: bash - run: | - ./.github/actions/kamel-preflight-test/preflight-test.sh \ - -b "${{ inputs.catalog-source-name }}" \ - -c "${{ inputs.catalog-source-namespace }}" \ - -i "${{ inputs.image-namespace }}" \ - -l "${{ inputs.image-registry-host }}" \ - -n "${{ inputs.image-name }}" \ - -s "${{ inputs.image-registry-insecure }}" \ - -v "${{ inputs.image-version }}" diff --git a/.github/actions/kamel-preflight-test/preflight-test.sh b/.github/actions/kamel-preflight-test/preflight-test.sh deleted file mode 100755 index 3389db22b..000000000 --- a/.github/actions/kamel-preflight-test/preflight-test.sh +++ /dev/null @@ -1,293 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Execute a preflight test for checking the operator is at the correct version -# -#### - -set -e - -NAMESPACE="preflight" - -delns() { - echo "Deleting namespace ${1}" - set +e - kubectl delete ns ${1} &> /dev/null - set -e -} - -waitForOperator() { - # - # Wait for the operator to be running - # - local timeout=360 - local i=1 - local command="kubectl get pods -n ${NAMESPACE} 2> /dev/null | grep camel-k-operator | grep Running &> /dev/null" - - until eval "${command}" - do - ((i++)) - if [ "${i}" -gt "${timeout}" ]; then - echo "kamel operator not successfully installed, aborting due to ${timeout}s timeout" - resources="pods csvs deployments subs" - for resource in ${resources} - do - echo "Dumping resourse: ${resource}" - kubectl get ${resource} -n "${NAMESPACE}" -o yaml - done - delns "${NAMESPACE}" - exit 1 - fi - - sleep 1 - done -} - -while getopts ":b:c:i:l:n:s:v:" opt; do - case "${opt}" in - b) - BUILD_CATALOG_SOURCE_NAME=${OPTARG} - ;; - c) - BUILD_CATALOG_SOURCE_NAMESPACE=${OPTARG} - ;; - i) - IMAGE_NAMESPACE=${OPTARG} - ;; - l) - REGISTRY_PULL_HOST=${OPTARG} - ;; - n) - IMAGE_NAME=${OPTARG} - ;; - s) - REGISTRY_INSECURE=${OPTARG} - ;; - v) - IMAGE_VERSION=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${IMAGE_NAME}" ]; then - echo "Error: local-image-name not defined" - exit 1 -fi - -if [ -z "${IMAGE_VERSION}" ]; then - echo "Error: local-image-version not defined" - exit 1 -fi - -if [ -z "${IMAGE_NAMESPACE}" ]; then - echo "Error: image-namespace not defined" - exit 1 -fi - -if [ -z "${REGISTRY_PULL_HOST}" ]; then - echo "Error: image-registry-pull-host not defined" - exit 1 -fi - -if [ -z "${REGISTRY_INSECURE}" ]; then - echo "Error: image-registry-insecure not defined" - exit 1 -fi - -# -# Create the preflight test namespace -# -set +e -if kubectl get ns ${NAMESPACE} &> /dev/null -then - kubectl delete ns ${NAMESPACE} -fi -set -e - -kubectl create namespace ${NAMESPACE} -if [ $? != 0 ]; then - echo "Error: failed to create the ${NAMESPACE} namespace" - exit 1 -fi - -# Cluster environment -export CUSTOM_IMAGE=${IMAGE_NAME} -export CUSTOM_VERSION=${IMAGE_VERSION} - -# -# If bundle has been built and installed then use it -# -has_olm="false" -if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then - # - # Check catalog source is actually available - # - timeout=10 - catalog_ready=0 - until [ ${catalog_ready} -eq 1 ] || [ ${timeout} -eq 0 ] - do - echo "Info: Awaiting catalog source to become ready" - - STATE=$(kubectl get catalogsource ${BUILD_CATALOG_SOURCE_NAME} \ - -n ${BUILD_CATALOG_SOURCE_NAMESPACE} \ - -o=jsonpath='{.status.connectionState.lastObservedState}') - if [ "${STATE}" == "READY" ]; then - let catalog_ready=1 - echo "Info: Catalog source is ready" - continue - else - echo "Warning: catalog source status is not ready." - if [ "${timeout}" -eq 1 ]; then - kubectl get catalogsource ${BUILD_CATALOG_SOURCE_NAME} \ - -n ${BUILD_CATALOG_SOURCE_NAMESPACE} -o yaml - echo "Error: timed out while awaiting catalog source to start" - delns "${NAMESPACE}" - exit 1 - fi - fi - - sleep 1m - let timeout=${timeout}-1 - done - - if [ -z "${NEW_XY_CHANNEL}" ]; then - echo "Error: OLM Channel cannot be determined" - delns "${NAMESPACE}" - exit 1 - fi - - export KAMEL_INSTALL_OLM_SOURCE=${BUILD_CATALOG_SOURCE_NAME} - export KAMEL_INSTALL_OLM_SOURCE_NAMESPACE=${BUILD_CATALOG_SOURCE_NAMESPACE} - export KAMEL_INSTALL_OLM_CHANNEL="${NEW_XY_CHANNEL}" - has_olm="true" -fi - -export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo) -export KAMEL_INSTALL_REGISTRY=${REGISTRY_PULL_HOST} -export KAMEL_INSTALL_REGISTRY_INSECURE=${REGISTRY_INSECURE} -export KAMEL_INSTALL_OPERATOR_IMAGE=${CUSTOM_IMAGE}:${CUSTOM_VERSION} - -# Will only have an effect if olm=false -# since, for OLM, the csv determines the policy. -# (see kamel-build-bundle/build-bundle-image.sh) -export KAMEL_INSTALL_OPERATOR_IMAGE_PULL_POLICY="Always" - -# -# Install the operator to local namespace -# -kamel install -n ${NAMESPACE} --olm=${has_olm} --operator-id=camel-k-preflight -if [ $? != 0 ]; then - echo "Error: kamel install returned an error." - delns "${NAMESPACE}" - exit 1 -fi - -sleep 3 - -echo "Waiting for operator to start ..." -waitForOperator - -sleep 5 - -# -# Confirm the operator has not restarted -# -echo "Checking operator has not restarted ..." -waitForOperator - -echo "Finding the operator pod identifier" -for i in {1..5} -do - camel_operator=$(kubectl get pods -n ${NAMESPACE} | grep camel-k-operator | grep Running | awk '{print $1}') - if [ -n "${camel_operator}" ]; then - break - fi - - echo "Preflight Test: camel operator no longer running ... waiting on restart" - waitForOperator -done - -echo "Camel K operator ${camel_operator} up and running" -camel_op_version=$(kubectl logs ${camel_operator} -n ${NAMESPACE} | sed -n 's/.*"Camel K Operator Version: \(.*\)"}/\1/p') -camel_op_commit=$(kubectl logs ${camel_operator} -n ${NAMESPACE} | sed -n 's/.*"Camel K Git Commit: \(.*\)"}/\1/p') - -src_commit=$(git rev-parse HEAD) - -if [ -z "${camel_operator}" ]; then - echo "Preflight Test: Failure - No camel operator can be located in ${NAMESPACE}" - delns "${NAMESPACE}" - exit 1 -fi - -if [ -z "${camel_op_version}" ]; then - echo "Preflight Test: Failure - No camel operator version can be located for ${NAMESPACE} / ${camel_operator}" - delns "${NAMESPACE}" - exit 1 -fi - -if [ -z "${camel_op_commit}" ]; then - echo "Preflight Test: Failure - No camel operator commit can be located for ${NAMESPACE} / ${camel_operator}" - delns "${NAMESPACE}" - exit 1 -fi - -# -# Test whether the versions are the same -# -if [ "${camel_op_version}" != "${IMAGE_VERSION}" ]; then - echo "Preflight Test: Failure - Installed operator version ${camel_op_version} does not match expected version (${IMAGE_VERSION})" - delns "${NAMESPACE}" - exit 1 -fi - -# -# Test whether the commit ids are the same -# -if [ "${camel_op_commit}" != "${src_commit}" ]; then - echo "Preflight Test: Failure - Installed operator commit id (${camel_op_commit}) does not match expected commit id (${src_commit})" - delns "${NAMESPACE}" - exit 1 -fi - -# -# Tidy-up and remove the operator from preflight -# -kamel uninstall -n ${NAMESPACE} -if [ $? != 0 ]; then - echo "Error: kamel uninstall failed while removing preflight install" - delns "${NAMESPACE}" - exit 1 -fi - -sleep 3 - -echo "Preflight Test: Success" - -delns "${NAMESPACE}" diff --git a/.github/actions/kamel-report-problematic/action.yml b/.github/actions/kamel-report-problematic/action.yml deleted file mode 100644 index c981858ab..000000000 --- a/.github/actions/kamel-report-problematic/action.yml +++ /dev/null @@ -1,35 +0,0 @@ -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -name: kamel-report-problematic -description: 'Reports the number of tests labelled as problematic in test suite' - -inputs: - test-suite: - description: "The test suite to be analysed" - required: true - -runs: - using: "composite" - steps: - - id: report-problematic - name: Report Tests Marked As Problematic - shell: bash - if: ${{ always() }} - run: | - ./.github/actions/kamel-report-problematic/report-problematic.sh \ - -t "${{ inputs.test-suite }}" diff --git a/.github/actions/kamel-report-problematic/report-problematic.sh b/.github/actions/kamel-report-problematic/report-problematic.sh deleted file mode 100755 index 03a6b17bd..000000000 --- a/.github/actions/kamel-report-problematic/report-problematic.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -#### -# -# Find all test that are labelled as problematic -# -#### - -set -e - -while getopts ":t:" opt; do - case "${opt}" in - t) - TEST_SUITE=${OPTARG} - ;; - :) - echo "ERROR: Option -$OPTARG requires an argument" - exit 1 - ;; - \?) - echo "ERROR: Invalid option -$OPTARG" - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${TEST_SUITE}" ]; then - echo "Error: ${0} -t <test-suite>" - exit 1 -fi - -TEST_DIR="./e2e/${TEST_SUITE}" - -if [ ! -d "${TEST_DIR}" ]; then - echo "No e2e directory available ... exiting" - exit 0 -fi - -PROBLEMATIC=() -while IFS= read -r -d '' f -do - - func="" - while IFS= read -r line - do - if [[ "${line}" =~ ^[\ ]+\*[\ ] ]]; then - # Ignore comments - continue - elif [[ "${line}" =~ ^func* ]]; then - func=$(echo "${line}" | sed -n "s/func \([a-zA-Z0-9]\+\).*/\1/p") - elif [[ "${line}" =~ CAMEL_K_TEST_SKIP_PROBLEMATIC ]]; then - PROBLEMATIC[${#PROBLEMATIC[*]}]="${f}::${func}" - fi - done < ${f} - -done < <(find "${TEST_DIR}" -name "*.go" -print0) - -if [ "${CAMEL_K_TEST_SKIP_PROBLEMATIC}" == "true" ]; then - if [ ${#PROBLEMATIC[*]} -gt 0 ]; then - echo "=== Problematic Tests (${#PROBLEMATIC[*]}) ===" - for prob in "${PROBLEMATIC[@]}" - do - echo " ${prob}" - done - echo "===" - else - echo "=== No Tests marked as Problematic ===" - fi -else - echo "=== All tests to be executed, including those marked as problematic (${#PROBLEMATIC[*]}) ===" -fi diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index aeb729e44..50f5b480c 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -49,22 +49,6 @@ on: - 'LICENSE' - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - Filter the tests in this test suite by assigning the test pattern to TEST_KNATIVE_RUN, - eg. TEST_KNATIVE_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index bdd2634b4..0527e2a8e 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -52,25 +52,6 @@ on: - 'LICENSE' - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - List of comma-separated key/value pairs to filter the tests in this test suite: - TEST_INTEGRATION_COMMON_RUN, TEST_INTEGRATION_COMMON_BUILD_RUN, TEST_INTEGRATION_COMMON_CONFIG_RUN, - TEST_INTEGRATION_COMMON_LANG_RUN, TEST_INTEGRATION_COMMON_TRAITS_RUN - TEST_SERVICE_RUN, TEST_REGISTRY_MAVEN_WAGON_RUN - eg. TEST_INTEGRATION_COMMON_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 2c2755359..73f84ac68 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -50,24 +50,6 @@ on: - 'LICENSE' - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - List of comma-separated key/value pairs to filter the tests in this test suite: - TEST_INSTALL_RUN, TEST_INSTALL_CLI_RUN, - TEST_INSTALL_KUSTOMIZE_RUN, TEST_QUARKUS_RUN - eg. TEST_INTEGRATION_COMMON_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/knative.yml b/.github/workflows/knative.yml index f70f203e6..cf2d4b097 100644 --- a/.github/workflows/knative.yml +++ b/.github/workflows/knative.yml @@ -48,22 +48,6 @@ on: - 'LICENSE' - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - Filter the tests in this test suite by assigning the test pattern to TEST_KNATIVE_RUN, - eg. TEST_KNATIVE_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 85362b640..0c20496cb 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -53,22 +53,6 @@ on: - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - Filter the tests in this test suite by assigning the test pattern to TEST_NATIVE_RUN, - eg. TEST_NATIVE_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/telemetry.yml b/.github/workflows/telemetry.yml index 1e31ce1bb..3f7fd6848 100644 --- a/.github/workflows/telemetry.yml +++ b/.github/workflows/telemetry.yml @@ -48,22 +48,6 @@ on: - 'LICENSE' - 'NOTICE' workflow_dispatch: - inputs: - log-level: - description: 'Set the operator log level (info or debug)' - required: false - pre-built-kamel-image: - description: 'Kamel image url for skipping building of kamel stages. Used for debugging' - required: false - skip-problematic: - description: 'Whether tests marked as problematic should be skipped - false by default (sets CAMEL_K_TEST_SKIP_PROBLEMATIC)' - required: false - default: false - test-filters: - description: | - Filter the tests in this test suite by assigning the test pattern to TEST_TELEMETRY_RUN, - eg. TEST_TELEMETRY_RUN=TestBasic will only run tests prefixed with 'TestBasic' - required: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
