in scripts/cpd_install.py [0:0]
def updateScc(self,icpdInstallLogFile):
"""
This method is used to update the SCC required for portworx installation.
"""
methodName = "updateScc"
TR.info(methodName,"Start Updating SCC for Portworx Installation")
"""
oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:px-account
oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:portworx-pvc-controller-account
oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:px-lh-account
oc adm policy add-scc-to-user anyuid system:serviceaccount:kube-system:px-lh-account
oc adm policy add-scc-to-user anyuid system:serviceaccount:default:default
oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:px-csi-account
"""
list = ["px-account","portworx-pvc-controller-account","px-lh-account","px-csi-account"]
oc_adm_cmd = "oc adm policy add-scc-to-user privileged system:serviceaccount:kube-system:"
for scc in list:
cmd = oc_adm_cmd+scc
TR.info(methodName,"Run get_nodes command %s"%cmd)
try:
retcode = check_output(['bash','-c', cmd])
TR.info(methodName,"Completed %s command with return value %s" %(cmd,retcode))
except CalledProcessError as e:
TR.error(methodName,"command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
cmd = "oc adm policy add-scc-to-user anyuid system:serviceaccount:default:default"
try:
retcode = check_output(['bash','-c', cmd])
TR.info(methodName,"Completed %s command with return value %s" %(cmd,retcode))
except CalledProcessError as e:
TR.error(methodName,"command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
cmd = "oc adm policy add-scc-to-user anyuid system:serviceaccount:kube-system:px-lh-account"
try:
retcode = check_output(['bash','-c', cmd])
TR.info(methodName,"Completed %s command with return value %s" %(cmd,retcode))
except CalledProcessError as e:
TR.error(methodName,"command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
TR.info(methodName,"Done Updating SCC for Portworx Installation")