From 01eb24ef77c34ac4dc4464e079f98f5cd4bf1ba0 Mon Sep 17 00:00:00 2001 From: Raj <54686422+LeelaChacha@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:31:08 +0200 Subject: [PATCH 1/2] chore: Deprecate .spec.channel field in ModuleTemplate API (#1932) * chore: deprecate .spec.channel field in ModuleTemplate API * chore: update manifests * fix: match moduletemplate api versions * fix: match moduletemplate api versions --------- Co-authored-by: Jeremy Harisch <48282931+jeremyharisch@users.noreply.github.com> --- api/v1beta1/moduletemplate_types.go | 3 +++ api/v1beta2/moduletemplate_types.go | 3 +++ .../operator.kyma-project.io_moduletemplates.yaml | 14 +++++++------- docs/contributor/resources/03-moduletemplate.md | 8 +++++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/api/v1beta1/moduletemplate_types.go b/api/v1beta1/moduletemplate_types.go index f421ce98bd..c93b5f422c 100644 --- a/api/v1beta1/moduletemplate_types.go +++ b/api/v1beta1/moduletemplate_types.go @@ -45,6 +45,9 @@ type ModuleTemplate struct { type ModuleTemplateSpec struct { // Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template // to a target channel. It has to be provided at any given time. + // Deprecated: This field is deprecated and will be removed in a future release. + // +optional + // +kubebuilder:deprecatedversion // +kubebuilder:validation:Pattern:=^[a-z]+$ // +kubebuilder:validation:MaxLength:=32 // +kubebuilder:validation:MinLength:=3 diff --git a/api/v1beta2/moduletemplate_types.go b/api/v1beta2/moduletemplate_types.go index 9601f4f274..9a0cc6d026 100644 --- a/api/v1beta2/moduletemplate_types.go +++ b/api/v1beta2/moduletemplate_types.go @@ -76,6 +76,9 @@ func (d *Descriptor) DeepCopyObject() machineryruntime.Object { type ModuleTemplateSpec struct { // Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template // to a target channel. It has to be provided at any given time. + // Deprecated: This field is deprecated and will be removed in a future release. + // +optional + // +kubebuilder:deprecatedversion // +kubebuilder:validation:Pattern:=^[a-z]+$ // +kubebuilder:validation:MaxLength:=32 // +kubebuilder:validation:MinLength:=3 diff --git a/config/crd/bases/operator.kyma-project.io_moduletemplates.yaml b/config/crd/bases/operator.kyma-project.io_moduletemplates.yaml index 966293c44f..f3f250d56d 100644 --- a/config/crd/bases/operator.kyma-project.io_moduletemplates.yaml +++ b/config/crd/bases/operator.kyma-project.io_moduletemplates.yaml @@ -49,6 +49,7 @@ spec: description: |- Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template to a target channel. It has to be provided at any given time. + Deprecated: This field is deprecated and will be removed in a future release. maxLength: 32 minLength: 3 pattern: ^[a-z]+$ @@ -119,7 +120,6 @@ spec: - remote type: string required: - - channel - descriptor - target type: object @@ -180,6 +180,7 @@ spec: description: |- Channel is the targeted channel of the ModuleTemplate. It will be used to directly assign a Template to a target channel. It has to be provided at any given time. + Deprecated: This field is deprecated and will be removed in a future release. maxLength: 32 minLength: 3 pattern: ^[a-z]+$ @@ -259,19 +260,19 @@ spec: description: Name is the name of the icon. type: string required: - - link - - name + - link + - name type: object type: array x-kubernetes-list-map-keys: - - name + - name x-kubernetes-list-type: map repository: description: Repository is the link to the repository of the module. type: string required: - - documentation - - repository + - documentation + - repository type: object mandatory: description: |- @@ -310,7 +311,6 @@ spec: pattern: ^((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[a-zA-Z-][0-9a-zA-Z-]*)?)?$ type: string required: - - channel - descriptor type: object type: object diff --git a/docs/contributor/resources/03-moduletemplate.md b/docs/contributor/resources/03-moduletemplate.md index 019b63288e..e7d5802a49 100644 --- a/docs/contributor/resources/03-moduletemplate.md +++ b/docs/contributor/resources/03-moduletemplate.md @@ -12,9 +12,11 @@ kubectl get crd moduletemplates.operator.kyma-project.io -o yaml ## Configuration -### **.spec.channel** +### **.spec.channel** (Deprecated) -The channel that a ModuleTemplate CR is registered in. It is used alongside the channel attributes of the Kyma CR to match up a module and a channel. +The `channel` field previously indicated the channel in which a ModuleTemplate CR was registered. It was used alongside the channel attributes of the Kyma CR to match a module with a specific channel. + +**Note:** This field is now deprecated and will be removed in a future release. It has been decided that ModuleTemplates are now tied directly to versions, rather than being associated with channels. For the following ModuleTemplate CR: @@ -27,7 +29,7 @@ spec: channel: regular ``` -the module will be referenced by any Kyma CR asking for it in the `regular` channel. +the module was referenced by any Kyma CR asking for it in the `regular` channel. ### **.spec.data** From af0c5cb1089e17f6b29ef1386dd89e1d084dfb8c Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Fri, 11 Oct 2024 10:12:55 +0200 Subject: [PATCH 2/2] chore: Decouple build image job from e2e (#1950) * decouple build image from e2e test --- .github/workflows/build-image.yml | 14 +++++++++----- .github/workflows/create-release.yml | 2 +- .github/workflows/test-e2e.yml | 23 ++++++++++++++++++----- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3b8d371168..4f1dae7818 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -11,7 +11,8 @@ on: required: false type: string default: "" - + pull_request_target: + types: [ opened, edited, synchronize, reopened, ready_for_review ] permissions: id-token: write # This is required for requesting the JWT token contents: read # This is required for actions/checkout @@ -29,11 +30,14 @@ jobs: run: | if [[ "${{ inputs.tag }}" != "" ]]; then echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT - elif [[ "${{ github.event_name }}" == "push" ]]; then - echo "tag=latest" >> $GITHUB_OUTPUT + else + { + echo 'tag<> "$GITHUB_OUTPUT" fi - - name: Echo the tag - run: echo ${{ steps.get_tag.outputs.tag }} build-image: needs: compute-tag uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d1cc7e843f..069d824a13 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -73,7 +73,7 @@ jobs: env: ITERATIONS: 40 SLEEP_SECONDS: 30 - run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.inputs.name }} $ITERATIONS $SLEEP_SECONDS + run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.inputs.name }} ${{ env.ITERATIONS }} ${{ env.SLEEP_SECONDS }} - name: Publish release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 5ed84ed7e8..b5c9c52ecb 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -1,20 +1,33 @@ name: TestSuite E2E +env: + IMAGE_REPO: europe-docker.pkg.dev/kyma-project/dev/lifecycle-manager on: workflow_dispatch: inputs: k8s_version: description: With Kubernetes version required: false - pull_request_target: + pull_request: types: [ opened, edited, synchronize, reopened, ready_for_review ] jobs: - build-image: - name: Build Image - uses: ./.github/workflows/build-image.yml + wait-for-image-build: + name: Wait for image build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Wait for the Docker image + timeout-minutes: 20 + env: + ITERATIONS: 40 + SLEEP_SECONDS: 30 + run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.pull_request.head.sha }} ${{ env.ITERATIONS }} ${{ env.SLEEP_SECONDS}} e2e-integration: name: E2E - needs: build-image + needs: wait-for-image-build strategy: fail-fast: false matrix: