Skip to content

Commit

Permalink
Merge pull request #173 from sassoftware/develop
Browse files Browse the repository at this point in the history
Prepare for release 1.8.1
  • Loading branch information
kevinlinglesas authored Jun 16, 2022
2 parents 468d343 + 1d13347 commit 85e5b59
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions pre_install_report/library/pre_install_check_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 85e5b59

Please sign in to comment.