From 7281a0784f67bd35c911bc4bb87e37adab17e091 Mon Sep 17 00:00:00 2001 From: Latha Sivakumar Date: Tue, 7 Jun 2022 16:11:55 -0400 Subject: [PATCH] (#171) Remove the check for kubectl api-resources --- .../library/pre_install_check_permissions.py | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/pre_install_report/library/pre_install_check_permissions.py b/pre_install_report/library/pre_install_check_permissions.py index 9495372..a87b603 100644 --- a/pre_install_report/library/pre_install_check_permissions.py +++ b/pre_install_report/library/pre_install_check_permissions.py @@ -624,36 +624,23 @@ def check_deploy_crd(self): def check_rbac_role(self): """ - Check if RBAC is enabled in specified namespace - Create the Role and Rolebinding for the custom resource access with specified namespace. Set the + Check if RBAC is enabled in specified namespace. + Create the Role, Rolebinding, and Serviec account in the specified namespace. Set the permissions status in the namespace_admin_permission_data dict object. """ - found = self.utils.get_rbac_group_cmd() - self.logger.debug("get_rbac_group_cmd found = {}, sample_deployment = {}" - .format(str(found), str(self._sample_deployment))) - if found: - rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, - 'viya-role.yaml') + rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, + 'viya-role.yaml') - self._set_results_cluster_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLE, rc) + self._set_results_cluster_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLE, rc) - rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, - 'crservice_acct.yaml') - self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_SA, rc) + rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, + 'crservice_acct.yaml') + self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_SA, rc) - rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, - 'viya-rolebinding.yaml') - self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLEBINDING, rc) - else: - self.logger.debug("sample_deployment = {}".format(str(self._sample_deployment))) - self.namespace_admin_permission_aggregate["RBAC Checking"] = viya_constants.PERM_SKIPPING - self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLE, - int(self._sample_deployment)) - self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_SA, - int(self._sample_deployment)) - self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLEBINDING, - int(self._sample_deployment)) + rc = self.utils.deploy_manifest_file(viya_constants.KUBECTL_APPLY, + 'viya-rolebinding.yaml') + self._set_results_namespace_admin(viya_constants.PERM_CREATE + viya_constants.PERM_ROLEBINDING, rc) def check_rbac_delete_role(self): """