Skip to content

Commit

Permalink
Fix python style
Browse files Browse the repository at this point in the history
And apply static plugin

Signed-off-by: Toni Finger <[email protected]>
  • Loading branch information
tonifinger committed Sep 18, 2024
1 parent bfd1a0f commit 9747f3c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Tests/kaas/plugin/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _test_k8s_cncf_conformance(self):
:param: None
:return: None
"""
logger.info(f" invoke cncf conformance test")
logger.info(" invoke cncf conformance test")
# ~ os.system(f"sonobuoy run --wait --mode=certified-conformance --kubeconfig='{self.kubeconfig_path}'")
# TODO:!!! switch to the real test on the final merge !!!
# Only one test is currently being carried out for development purposes
Expand All @@ -99,7 +99,7 @@ def _cleanup_sonobuoy_resources(self):
:param: None
:return: None
"""
logger.info(f"removing sonobuoy tests from cluster")
logger.info("removing sonobuoy tests from cluster")
os.system(f"sonobuoy delete --wait --kubeconfig='{self.kubeconfig_path}'")

@final
Expand Down
11 changes: 5 additions & 6 deletions Tests/kaas/plugin/plugin_kind.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from interface import KubernetesClusterPlugin
from pytest_kind import KindCluster
from pathlib import Path


class PluginKind(KubernetesClusterPlugin):
"""
Plugin to handle the provisioning of kubernetes cluster for
Plugin to handle the provisioning of kubernetes cluster for
conformance testing purpose with the use of Kind
"""

def _create_cluster(self):
self.cluster_name= "scs-cluster"
self.cluster_name = "scs-cluster"
self.cluster = KindCluster(self.cluster_name)
self.cluster.create()
self.kubeconfig_path=str(self.cluster.kubeconfig_path.resolve())
self.kubeconfig_path = str(self.cluster.kubeconfig_path.resolve())

def _delete_cluster(self):
self.cluster.delete()

14 changes: 14 additions & 0 deletions Tests/kaas/plugin/plugin_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from interface import KubernetesClusterPlugin
import os


class PluginStatic(KubernetesClusterPlugin):
"""
Plugin to handle the provisioning of kubernetes
using a kubeconfig file
"""
def _create_cluster(self):
self.kubeconfig_path = os.environ["KUBECONFIG"]

def _delete_cluster(self):
pass
1 change: 1 addition & 0 deletions Tests/kaas/plugin/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from plugin_kind import PluginKind
from plugin_static import PluginStatic
import os

if __name__ == "__main__":
Expand Down

0 comments on commit 9747f3c

Please sign in to comment.