Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf committed Jul 11, 2024
1 parent f2a3803 commit 081b025
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/user/migration-guide/v6-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ As a result of the restructure, some imports need to be adjusted:

## [Call destroy from inside of reset or clean](https://github.com/bakdata/kpops/pull/501)

Before v7, the KPOps CLI called the destroy method before reset/clean to ensure the component was destroyed.
Before v7, the KPOps CLI executed `destroy` before running `reset/clean` to ensure the component was destroyed.

This logic has changed. From now on, the `destroy` method should be called within the `clean/reset` method if needed.
This logic has changed. From now on, the `destroy` method should be called within the `reset/clean` method if needed by the user.

During the migration to v7, you should check your custom components and see if they are overriding the `clean/reset` methods. If so, you would need to add the `destroy` method at the beginning of your override.
During the migration to v7, you should check your custom components and see if they are overriding the `reset/clean` methods. If so, you would need to add the `destroy` method at the beginning of your `reset/clean` override.

### components.py
#### components.py

In the following example, we must call the `destroy` method inside the `clean` method. ** Otherwise, the logic of destroy will not be executed by KPOps!**
In the following example, we must call the `destroy` method inside the `clean` method. ** Otherwise, the logic of destroy will not be executed!**

```diff
class MyCustomComponent(PipelineComponent):
Expand All @@ -83,7 +83,7 @@ class MyCustomComponent(PipelineComponent):

@override
async def clean(self, dry_run: bool) -> None:
+ destroy(dry_run)
+ destroy(dry_run)
# Some custom clean logic
# ...
```

0 comments on commit 081b025

Please sign in to comment.