Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup #399

Merged
merged 6 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
run: |
make -C hack/ci/ install-k3d-tools


- name: Install Kyma CLI & setup k3d cluster using kyma CLI
run: |
make kyma
Expand Down
71 changes: 0 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,77 +168,6 @@ To delete the CRDs from the cluster:
make uninstall
```

### Deploy Eventing Manager Module With [Kyma Lifecycle Manager](https://github.com/kyma-project/lifecycle-manager/tree/main)

1. Deploy the Lifecycle Manager to the Kubernetes cluster:

```shell
kyma alpha deploy
```

2. Apply the Eventing module template to the Kubernetes cluster:

> **NOTE:** You can get the latest released [module template](https://github.com/kyma-project/eventing-manager/releases/latest/download/module-template.yaml), or you can use the module template from the artifacts of `eventing-module-build` job either from the `main` branch or from your pull request.
```sh
kubectl apply -f module-template.yaml
```

3. Enable the Eventing module:

```sh
kyma alpha enable module eventing -c fast -n kyma-system
```

4. If you want to verify whether your Eventing module is deployed properly, perform the following checks:

- Check if the Eventing resource has the `ready` state:

```shell
kubectl get -n kyma-system eventing
```

- Check if the Kyma resource has the ready state:

```shell
kubectl get -n kyma-system kyma
```

### Uninstall Eventing Manager Module With [Kyma Lifecycle Manager](https://github.com/kyma-project/lifecycle-manager/tree/main)

1. Delete Eventing custom resource (CR) from the Kubernetes cluster (if exists):

```sh
kubectl delete -n kyma-system eventing eventing
```

2. Disable the Eventing module:

```sh
kyma alpha disable module eventing
```

3. Delete the Eventing module template:

```sh
kubectl get moduletemplates -A
kubectl delete moduletemplate -n <NAMESPACE> <NAME>
```

4. Check whether your Eventing module is uninstalled properly:

- Make sure that the Eventing CR does not exist. If it exists, check its status:

```shell
kubectl get -n kyma-system eventing eventing -o yaml
```

- Check if the Kyma resource has the `ready` state:

```shell
kubectl get -n kyma-system kyma
```

## End-to-End Tests

See [hack/e2e/README.md](hack/e2e/README.md)
Expand Down
61 changes: 0 additions & 61 deletions hack/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,14 @@ KYMA_CLI ?= "${PROJECT_ROOT}/${KYMA}"
CLUSTER_NAME ?= kyma
REGISTRY_PORT ?= 5001

ifndef MODULE_VERSION
include ${PROJECT_ROOT}/.version
endif

ifndef MODULE_SHA
MODULE_SHA = ${shell git rev-parse --short HEAD}
endif

.PHONY: module-build
module-build: ## Build the Module, push it to a registry and print it based on the commit hash.
@make -C ${PROJECT_ROOT} module-build \
IMG=${IMG} \
MODULE_REGISTRY=${MODULE_REGISTRY} \
MODULE_VERSION=${MODULE_VERSION}-${MODULE_SHA}
cp -f ${PROJECT_ROOT}/module-template.yaml ${ARTIFACTS}/module-template.yaml
@echo "Added template to job artifacts: ${ARTIFACTS}/module-template.yaml"
@echo "\n~~~~~~~~~~~~BEGINNING OF MODULE TEMPLATE~~~~~~~~~~~~~~"
@cat ${ARTIFACTS}/module-template.yaml
@echo "\n~~~~~~~~~~~~~~~END OF MODULE TEMPLATE~~~~~~~~~~~~~~~~"

.PHONY: download-module-template
download-module-template: ## Downloads the module-template from the module-build prow job.
export PROJECT_ROOT="${PROJECT_ROOT}" \
&& ../get_module_template_from_build_job.sh
friedrichwilken marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: install-latest-module-template-fast
install-latest-module-template-fast: ## Downloads and applies the latest released module-template from fast channel.
kubectl apply -f https://github.com/kyma-project/eventing-manager/releases/latest/download/module-template.yaml

.PHONY: create-kyma-system-ns
create-kyma-system-ns: ## Create kyma-system namespace.
kubectl create ns kyma-system

.PHONY: install-module-template
install-module-template: ## Apply Eventing moduletemplate.
kubectl apply -f ${PROJECT_ROOT}/module-template.yaml

.PHONY: enable-module-without-default-cr
enable-module-without-default-cr: ## Enable Eventing module without creating default Eventing CR.
"${KYMA_CLI}" alpha enable module eventing -c fast -n kyma-system -p Ignore

.PHONY: install-lifecycle-manager
install-lifecycle-manager: ## Deploys lifecycle-manager.
"${KYMA_CLI}" alpha deploy \
--ci \
--force-conflicts

.PHONY: create-k3d
create-k3d: ## Create k3d with kyma CRDs.
"${KYMA_CLI}" provision k3d -p 8081:80@loadbalancer -p 8443:443@loadbalancer --registry-port ${REGISTRY_PORT} --name ${CLUSTER_NAME} --ci

.PHONY: install-lifecycle-manager
install-lifecycle-manager: ## Deploys lifecycle-manager.
"${KYMA_CLI}" alpha deploy \
--ci \
--force-conflicts

.PHONY: install-latest-nats-module-template-fast
install-latest-nats-module-template-fast: ## Downloads and applies the latest nats-manager released module-template from fast channel.
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/module-template.yaml

.PHONY: enable-nats-module
enable-nats-module:
"${KYMA_CLI}" alpha enable module nats -c fast -f --ci -n kyma-system

.PHONY: get-nats-via-lifecycle-manager
get-nats-via-lifecycle-manager: install-lifecycle-manager install-latest-nats-module-template-fast enable-nats-module
./check-k8s-resource-is-ready.sh 180 nats kyma-system

.PHONY: install-nats-module
install-nats-module:
kubectl apply -f https://github.com/kyma-project/nats-manager/releases/latest/download/nats-manager.yaml
Expand Down
7 changes: 3 additions & 4 deletions testing/eventmeshmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,9 @@ func (m *EventMeshMock) handleMessaging() func(w http.ResponseWriter, r *http.Re
if err == nil {
break
}
two := 2
three := 3
if i < two { // Don't sleep after the last attempt
time.Sleep(time.Duration(three) * time.Second)
attempts, duration := 2, 3
if i < attempts { // Don't sleep after the last attempt.
time.Sleep(time.Duration(duration) * time.Second)
} else {
m.log.Error(err, "failed to update state response")
w.WriteHeader(http.StatusBadRequest)
Expand Down