Skip to content

Commit

Permalink
cherry-pick changes from main (#332)
Browse files Browse the repository at this point in the history
* Moved api pkg from eventing-controller (#260)

* Moved api pkg from eventing-controller

* updated samples

* Fix failing tests

* Delete external CRD folder

* Revert 02-configuration.md doc

---------

Co-authored-by: Mansur Uralov <[email protected]>

* Cache runtime objects only created by the EventingManager (#273)

* Cache runtime objects only created by the EventingManager

* Update test case name

* Semantic versioning in security scan config (#319)

* check_image.sh

* check_image.sh

* release.sh

* Remove `.version` file check in release

* Call retry function

* Refactoring

* Verify status

* Check tags in security-scan-config.yaml

* Check on both place

* Collect latest run related data

* Checkout code (#323)

* Release input variable for tag checking (#324)

* Release input variable for tag checking (#326)

* Release input variable for tag checking

* Remove whitespace

* Remove white space at rc-tag

* Initial Wait Time (#327)

* Initial Wait Time

* Parameters

* Remove first check

* Run github action workflows on release-branches. (#330)

* tidy go.mod

* bump golangcli-lint vesion

* bump release version

---------

Co-authored-by: Muhammad Faizan <[email protected]>
Co-authored-by: Mansur Uralov <[email protected]>
Co-authored-by: Marco Bebway <[email protected]>
Co-authored-by: Tibor Kiss <[email protected]>
  • Loading branch information
5 people authored Dec 14, 2023
1 parent 2916c7c commit c860aae
Show file tree
Hide file tree
Showing 159 changed files with 5,717 additions and 1,034 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
name:
description: 'Release name'
description: 'Release name ( e.g. "2.1.3" )'
default: ""
required: true

jobs:
verify-head-status:
name: Verify head
name: Verify head (image version and prow job)
runs-on: ubuntu-latest

steps:
Expand All @@ -19,18 +19,22 @@ jobs:
with:
fetch-depth: 0

- name: Check tag
run: ./scripts/check_release_tag.sh ${{ github.event.inputs.name }}

- name: Check image
run: ./scripts/check_image.sh ${{ github.ref_name }}

- name: Verify
run: ./scripts/verify-status.sh ${{ github.ref_name }}

# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
- name: Verify that the current branch has a name that starts with 'release-'
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$CURRENT_BRANCH" == release-* ]]; then
echo "Branch name starts with 'release-'."
else
echo "Branch name does not start with 'release-'."
exit 1
fi
- name: Check image Tag
run: ./scripts/check_tag_info.sh ${{ github.event.inputs.name }}

# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
# uses: "./.github/workflows/run-unit-tests.yaml"

create-draft:
Expand Down Expand Up @@ -62,6 +66,9 @@ jobs:
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}
- name: Verify job status
run: ./scripts/verify-status.sh ${{ github.ref_name }} 600 10 30

outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

Expand All @@ -84,4 +91,4 @@ jobs:
- name: Publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}
12 changes: 7 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ env:

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
nats:
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
- name: Setup and test the eventing-manager
run: |
make e2e-setup
make e2e-setup
- name: Setup eventing
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: golangci-lint

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

permissions:
contents: read
Expand All @@ -19,14 +21,14 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52
version: v1.55
args: --timeout=5m

# Optional: working directory, useful for monorepos
Expand Down
100 changes: 51 additions & 49 deletions .github/workflows/sink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ env:
on:
push:
branches:
- main
tags: [ '*.*.*' ]
- main
- "release-*"
tags: ["*.*.*"]
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"
pull_request:
branches:
- main
- main
- "release-*"
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"

jobs:
build:
Expand All @@ -32,51 +34,51 @@ jobs:
working-directory: ${{ env.E2E_SINK_DIR }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
cache: true

- name: Build
run: go build -v ./...
- name: Build
run: go build -v ./...

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
22 changes: 13 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
unit:
Expand All @@ -26,7 +30,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- name: Sync GO dependencies
run: |
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"

jobs:
crd:
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# next version to be released
MODULE_VERSION=1.0.1
MODULE_VERSION=1.0.2
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,9 @@ ifndef ignore-not-found
endif

.PHONY: install
install: download-external-crds manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -

.PHONY: download-external-crds
download-external-crds:
curl -s -L -o config/crd/external/subscriptions.eventing.kyma-project.io.crd.yaml https://raw.githubusercontent.com/kyma-project/kyma/main/installation/resources/crds/eventing/subscriptions.eventing.kyma-project.io.crd.yaml

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
Expand Down
27 changes: 26 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ resources:
domain: kyma-project.io
group: operator
kind: Eventing
path: github.com/kyma-project/eventing-manager/api/batch/v1alpha1
path: github.com/kyma-project/eventing-manager/api/operator/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: kyma-project.io
group: eventing
kind: Subscription
path: github.com/kyma-project/eventing-manager/api/eventing/v1alpha1
version: v1alpha1
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
domain: kyma-project.io
group: eventing
kind: Subscription
path: github.com/kyma-project/eventing-manager/api/eventing/v1alpha2
version: v1alpha2
webhooks:
defaulting: true
validation: true
conversion: true
webhookVersion: v1
version: "3"
Loading

0 comments on commit c860aae

Please sign in to comment.