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

Fix configmap name #207

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion systest_utils/statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
HELM_REPO = "kubescape/kubescape-operator"
CA_NAMESPACE_NAME = "kubescape"
CA_NAMESPACE_FROM_HELM_NAME = "kubescape"
CA_KUBESCAPE_CONFIGMAP_NAME = "kubescape-config"
CA_HELM_NAME = "kubescape"
CA_CONFIG = "ks-cloud-config"
KS_SECRET = "cloud-secret"
CA_CONFIGMAP_SERVICE_DISCOVERY_KEY = "services"
CA_OPERATOR_CONTAINER_FROM_HELM_NAME = "operator"
CA_OPERATOR_DEPLOYMENT_FROM_HELM_NAME = "operator"
Expand Down
6 changes: 3 additions & 3 deletions tests_scripts/kubescape/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def start(self):
return self.cleanup()

def compare_view_result(self):
ks_cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.CA_KUBESCAPE_CONFIGMAP_NAME)
ks_cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.KS_CONFIG)
cm_data = ks_cm_obj.data["config.json"]
cm_dict = json.loads(cm_data)

Expand Down Expand Up @@ -88,7 +88,7 @@ def compare_set_result(self):
with open(self.get_kubescape_config_file()) as f:
file_dict = json.load(f)
assert self.test_obj.kwargs["set_key"] in file_dict.keys(), f'key {self.test_obj.kwargs["set_key"]} should exist in the file {self.get_kubescape_config_file()}'
cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.CA_KUBESCAPE_CONFIGMAP_NAME)
cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.KS_CONFIG)
cm_data = cm_obj.data["config.json"]
cm_dict = json.loads(cm_data)
assert self.test_obj.kwargs["set_key"] not in cm_dict.keys() or self.test_obj.kwargs["set_key"] in cm_dict.keys() and cm_dict[self.test_obj.kwargs["set_key"]] != self.test_obj.kwargs["set_value"], f'key {self.test_obj.kwargs["set_key"]} should mot exist in the kubescape configmap:{cm_dict}'
Expand Down Expand Up @@ -123,7 +123,7 @@ def start(self):

def compare_view_result(self):
kubescape_config_file_path=self.get_kubescape_config_file()
cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.CA_KUBESCAPE_CONFIGMAP_NAME)
cm_obj = self.kubernetes_obj.get_config_map(namespace=statics.CA_NAMESPACE_FROM_HELM_NAME, name=statics.KS_CONFIG)
assert not(cm_obj) == False, f'the kubescape configmap should not be deleted'
assert os.path.exists(kubescape_config_file_path) == False, f'kubescape config file in path: {kubescape_config_file_path} should be deleted'