Skip to content

Commit

Permalink
add review
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf committed Sep 18, 2023
1 parent 795c974 commit cfb94e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 7 additions & 11 deletions kpops/components/base_components/kafka_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def helm(self) -> Helm:
return helm

@property
def _connector_resetter_release_name(self) -> str:
def _resetter_release_name(self) -> str:
"""Get connector resetter's release name"""
suffix = "-clean"
clean_up_release_name = self.full_name + suffix
Expand Down Expand Up @@ -188,9 +188,7 @@ def _run_connect_resetter(
f"Connector Cleanup: uninstalling cleanup job Helm release from previous runs for {self.full_name}"
)
)
self.__uninstall_connect_resetter(
self._connector_resetter_release_name, dry_run
)
self.__uninstall_connect_resetter(self._resetter_release_name, dry_run)

log.info(
magentaify(
Expand All @@ -202,14 +200,12 @@ def _run_connect_resetter(

if dry_run:
self.dry_run_handler.print_helm_diff(
stdout, self._connector_resetter_release_name, log
stdout, self._resetter_release_name, log
)

if not retain_clean_jobs:
log.info(magentaify("Connector Cleanup: uninstall Kafka Resetter."))
self.__uninstall_connect_resetter(
self._connector_resetter_release_name, dry_run
)
self.__uninstall_connect_resetter(self._resetter_release_name, dry_run)

def __install_connect_resetter(
self,
Expand All @@ -225,7 +221,7 @@ def __install_connect_resetter(
:return: The output of `helm upgrade --install`
"""
return self.helm.upgrade_install(
release_name=self._connector_resetter_release_name,
release_name=self._resetter_release_name,
namespace=self.namespace,
chart=self._resetter_helm_chart,
dry_run=dry_run,
Expand Down Expand Up @@ -300,7 +296,7 @@ def template(self) -> None:
offset_topic=self.offset_topic,
)
stdout = self.helm.template(
self._connector_resetter_release_name,
self._resetter_release_name,
self._resetter_helm_chart,
self.namespace,
values,
Expand Down Expand Up @@ -345,7 +341,7 @@ def add_input_topics(self, topics: list[str]) -> None:
def template(self) -> None:
values = self._get_kafka_connect_resetter_values()
stdout = self.helm.template(
self._connector_resetter_release_name,
self._resetter_release_name,
self._resetter_helm_chart,
self.namespace,
values,
Expand Down
4 changes: 1 addition & 3 deletions tests/components/test_kafka_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

DEFAULTS_PATH = Path(__file__).parent / "resources"
CONNECTOR_NAME = "test-connector-with-long-name-0123456789abcdefghijklmnop"
CONNECTOR_FULL_NAME = (
"${pipeline_name}-test-connector-with-long-name-0123456789abcdefghijklmnop"
)
CONNECTOR_FULL_NAME = "${pipeline_name}-" + CONNECTOR_NAME
CONNECTOR_CLEAN_FULL_NAME = "${pipeline_name}-test-connector-with-long-name-clean"
CONNECTOR_CLASS = "com.bakdata.connect.TestConnector"

Expand Down

0 comments on commit cfb94e0

Please sign in to comment.