diff --git a/.github/actions/deploy-lifecycle-manager-e2e/action.yaml b/.github/actions/deploy-lifecycle-manager-e2e/action.yaml new file mode 100644 index 00000000000..1fff090ba65 --- /dev/null +++ b/.github/actions/deploy-lifecycle-manager-e2e/action.yaml @@ -0,0 +1,91 @@ +name: Deploy lifecycle-manager E2E +description: Applies E2E test-specific patches to the lifecycle-manager kustomize and deploys it. +inputs: + klm_version_tag: + description: The version tag for the KLM image. For example, PR-123. + required: true + klm_image_repo: + description: The repository for the KLM image. For example, dev. + required: true +runs: + using: "composite" + steps: + - name: Patch purge finalizer flags + if: ${{ matrix.e2e-test == 'purge-controller' || matrix.e2e-test == 'purge-metrics'}} + working-directory: lifecycle-manager + shell: bash + run: | + pushd config/watcher_local_test + echo \ + "- op: add + path: /spec/template/spec/containers/0/args/- + value: --enable-purge-finalizer=true + - op: add + path: /spec/template/spec/containers/0/args/- + value: --purge-finalizer-timeout=5s" >> purge_finalizer.yaml + cat purge_finalizer.yaml + kustomize edit add patch --path purge_finalizer.yaml --kind Deployment + popd + - name: Patch metrics cleanup interval + if : ${{ matrix.e2e-test == 'kyma-metrics' }} + working-directory: lifecycle-manager + shell: bash + run: | + pushd config/watcher_local_test + echo \ + "- op: add + path: /spec/template/spec/containers/0/args/- + value: --metrics-cleanup-interval=1" >> metrics_cleanup.yaml + cat metrics_cleanup.yaml + kustomize edit add patch --path metrics_cleanup.yaml --kind Deployment + popd + - name: Patch self signed certificate lifetime + if: ${{matrix.e2e-test == 'self-signed-certificate-rotation'}} + working-directory: lifecycle-manager + shell: bash + run: | + pushd config/watcher_local_test + echo \ + "- op: add + path: /spec/template/spec/containers/0/args/- + value: --self-signed-cert-duration=1h + - op: add + path: /spec/template/spec/containers/0/args/- + value: --self-signed-cert-renew-before=59m + - op: add + path: /spec/template/spec/containers/0/args/- + value: --self-signed-cert-renew-buffer=1m" >> self-signed-cert.yaml + cat self-signed-cert.yaml + kustomize edit add patch --path self-signed-cert.yaml --kind Deployment + popd + - name: Patch CA certificate renewBefore + if: ${{matrix.e2e-test == 'ca-certificate-rotation'}} + working-directory: lifecycle-manager + shell: bash + run: | + pushd config/watcher_local_test + echo \ + "- op: replace + path: /spec/renewBefore + value: 59m + - op: replace + path: /spec/duration + value: 1h">> certificate_renewal.yaml + cat certificate_renewal.yaml + kustomize edit add patch --path certificate_renewal.yaml --kind Certificate --group cert-manager.io --version v1 --name watcher-serving-cert + popd + - name: Deploy LM local testing kustomize + uses: ./lifecycle-manager/.github/actions/deploy-lifecycle-manager + with: + klm_version_tag: ${{ inputs.klm_version_tag }} + klm_image_repo: ${{ inputs.klm_image_repo }} + - name: Expose Metrics Endpoint + working-directory: lifecycle-manager + if: ${{ matrix.e2e-test == 'kyma-metrics' || + matrix.e2e-test == 'purge-metrics' || + matrix.e2e-test == 'self-signed-certificate-rotation' || + matrix.e2e-test == 'mandatory-module-metrics' + }} + shell: bash + run: | + kubectl patch svc klm-metrics-service -p '{"spec": {"type": "LoadBalancer"}}' -n kcp-system diff --git a/.github/actions/deploy-lifecycle-manager/action.yaml b/.github/actions/deploy-lifecycle-manager/action.yaml index f35617ed824..81300dfc567 100644 --- a/.github/actions/deploy-lifecycle-manager/action.yaml +++ b/.github/actions/deploy-lifecycle-manager/action.yaml @@ -1,5 +1,5 @@ name: Deploy lifecycle-manager -description: Applies test-specific patches to the lifecycle-manager kustomize and deploys it. +description: Deploys lifecycle-manager. inputs: klm_version_tag: description: The version tag for the KLM image. For example, PR-123. @@ -10,70 +10,6 @@ inputs: runs: using: "composite" steps: - - name: Patch purge finalizer flags - if: ${{ matrix.e2e-test == 'purge-controller' || matrix.e2e-test == 'purge-metrics'}} - working-directory: lifecycle-manager - shell: bash - run: | - pushd config/watcher_local_test - echo \ - "- op: add - path: /spec/template/spec/containers/0/args/- - value: --enable-purge-finalizer=true - - op: add - path: /spec/template/spec/containers/0/args/- - value: --purge-finalizer-timeout=5s" >> purge_finalizer.yaml - cat purge_finalizer.yaml - kustomize edit add patch --path purge_finalizer.yaml --kind Deployment - popd - - name: Patch metrics cleanup interval - if : ${{ matrix.e2e-test == 'kyma-metrics' }} - working-directory: lifecycle-manager - shell: bash - run: | - pushd config/watcher_local_test - echo \ - "- op: add - path: /spec/template/spec/containers/0/args/- - value: --metrics-cleanup-interval=1" >> metrics_cleanup.yaml - cat metrics_cleanup.yaml - kustomize edit add patch --path metrics_cleanup.yaml --kind Deployment - popd - - name: Patch self signed certificate lifetime - if: ${{matrix.e2e-test == 'self-signed-certificate-rotation'}} - working-directory: lifecycle-manager - shell: bash - run: | - pushd config/watcher_local_test - echo \ - "- op: add - path: /spec/template/spec/containers/0/args/- - value: --self-signed-cert-duration=1h - - op: add - path: /spec/template/spec/containers/0/args/- - value: --self-signed-cert-renew-before=59m - - op: add - path: /spec/template/spec/containers/0/args/- - value: --self-signed-cert-renew-buffer=1m" >> self-signed-cert.yaml - cat self-signed-cert.yaml - kustomize edit add patch --path self-signed-cert.yaml --kind Deployment - popd - - name: Patch CA certificate renewBefore - if: ${{matrix.e2e-test == 'ca-certificate-rotation'}} - working-directory: lifecycle-manager - shell: bash - run: | - pushd config/watcher_local_test - echo \ - "- op: replace - path: /spec/renewBefore - value: 59m - - op: replace - path: /spec/duration - value: 1h">> certificate_renewal.yaml - cat certificate_renewal.yaml - kustomize edit add patch --path certificate_renewal.yaml --kind Certificate --group cert-manager.io --version v1 --name watcher-serving-cert - popd - name: Deploy LM local testing kustomize working-directory: lifecycle-manager shell: bash @@ -93,13 +29,3 @@ runs: exit 1 fi done - - name: Expose Metrics Endpoint - working-directory: lifecycle-manager - if: ${{ matrix.e2e-test == 'kyma-metrics' || - matrix.e2e-test == 'purge-metrics' || - matrix.e2e-test == 'self-signed-certificate-rotation' || - matrix.e2e-test == 'mandatory-module-metrics' - }} - shell: bash - run: | - kubectl patch svc klm-metrics-service -p '{"spec": {"type": "LoadBalancer"}}' -n kcp-system diff --git a/.github/workflows/test-e2e-junk.yaml b/.github/workflows/test-e2e-junk.yaml index 67f243b472b..764c7c873b3 100644 --- a/.github/workflows/test-e2e-junk.yaml +++ b/.github/workflows/test-e2e-junk.yaml @@ -78,7 +78,7 @@ jobs: cert_manager_version: ${{ steps.configuration.outputs.cert_manager_version }} - name: Deploy lifecycle-manager - uses: ./lifecycle-manager/.github/actions/deploy-lifecycle-manager + uses: ./lifecycle-manager/.github/actions/deploy-lifecycle-manager-e2e with: klm_version_tag: ${{ steps.configuration.outputs.klm_version_tag }} klm_image_repo: ${{ steps.configuration.outputs.klm_image_repo }}