From 3ddbd58bc5cc88675f4602316f8d4adcae5fc4b3 Mon Sep 17 00:00:00 2001 From: ilia1243 <8808144+ilia1243@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:34:53 +0300 Subject: [PATCH] Improvements and fixes in GitHub workflows (#591) * Fix collecting events if integration tests are failed * Make manifests original * Fix check that manifests are not changed manually * Run mypy on all python versions --- .github/workflows/integration_tests.yaml | 7 +++++-- .github/workflows/tests.yaml | 15 +++++++++++++-- .../plugins/yaml/calico-v3.26.1-original.yaml | 2 +- .../nginx-ingress-controller-v1.8.1-original.yaml | 4 ---- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 2c2c7bcfd..c7b67f9a6 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -75,6 +75,9 @@ jobs: - name: Check paas id: test_check_paas run: kubemarine check_paas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_paas_dump/ + - name: Get events kubectl + if: failure() + run: sudo kubectl get events --sort-by='.metadata.creationTimestamp' -A - name: Collect journalctl logs if: failure() run: | @@ -136,7 +139,7 @@ jobs: run: kubemarine check_paas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_paas_dump/ - name: Get events kubectl if: failure() - run: kubectl get events --sort-by='.metadata.creationTimestamp' -A + run: sudo kubectl get events --sort-by='.metadata.creationTimestamp' -A - name: Collect journalctl logs if: failure() run: | @@ -166,7 +169,7 @@ jobs: run: python scripts/thirdparties/sync.py --refresh-manifests - name: Check source code unchanged run: | - if ! git diff --exit-code; then + if ! git diff --staged --exit-code; then echo "" echo -e "\033[91mkubernetes_versions.yaml may be not synchronized with internal compatibility maps, or plugin manifests. See diff above.\033[0m" echo -e "\033[91mDo not change internal compatibility maps manually. Use scripts/thirdparties/sync.py to synchronize the compatibility maps.\033[0m" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b7582afdd..e8a693ed1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -61,11 +61,22 @@ jobs: xenon -a A kubemarine scripts mypy: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: +# - "3.7" # Currently used version of mypy does not work on Python 3.7 + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: ${{ matrix.python-version }} # Install kubemarine with all dependencies except ansible but including mypy and library stubs. # Then uninstall only kubemarine to avoid ambiguity and to surely run mypy on sources. - run: pip install .[mypy] && pip uninstall -y kubemarine diff --git a/kubemarine/plugins/yaml/calico-v3.26.1-original.yaml b/kubemarine/plugins/yaml/calico-v3.26.1-original.yaml index 003f9a78b..894970ae2 100644 --- a/kubemarine/plugins/yaml/calico-v3.26.1-original.yaml +++ b/kubemarine/plugins/yaml/calico-v3.26.1-original.yaml @@ -5135,4 +5135,4 @@ spec: port: 9098 host: localhost periodSeconds: 10 - timeoutSeconds: 10 \ No newline at end of file + timeoutSeconds: 10 diff --git a/kubemarine/plugins/yaml/nginx-ingress-controller-v1.8.1-original.yaml b/kubemarine/plugins/yaml/nginx-ingress-controller-v1.8.1-original.yaml index 98eb5e07b..659da1d1b 100644 --- a/kubemarine/plugins/yaml/nginx-ingress-controller-v1.8.1-original.yaml +++ b/kubemarine/plugins/yaml/nginx-ingress-controller-v1.8.1-original.yaml @@ -321,7 +321,6 @@ subjects: apiVersion: v1 data: allow-snippet-annotations: "true" - use-proxy-protocol: "true" kind: ConfigMap metadata: labels: @@ -336,8 +335,6 @@ metadata: apiVersion: v1 kind: Service metadata: - annotations: - service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "true" labels: app.kubernetes.io/component: controller app.kubernetes.io/instance: ingress-nginx @@ -646,4 +643,3 @@ webhooks: resources: - ingresses sideEffects: None - timeoutSeconds: 29 \ No newline at end of file