def getFull(self): """ Get full configuration (inlcuding discovered parts) as nested namespace """ logging.debug(f'self._config >>>{self._config}<<<') cleaned = ConfigBase.cleanup(self._config) logging.debug(f'cleaned >>>{cleaned}<<<') # return objToNestedNs(ConfigBase.cleanup(self._config)) return objToNestedNs(self._config)
def _setOrgUser(self): userSwitch = True orgUserName = self.ocWhoami() if orgUserName == "kube:admin": orgUserName = "******" # Check for known users if orgUserName == self._user.name: return self._user, userSwitch if orgUserName == self._admin.name: return self._admin, userSwitch userSwitch = False # ocp user not set before if orgUserName == "": return None, userSwitch return objToNestedNs({"name": orgUserName}), userSwitch
def get(self): """ Get cleaned up configuration as nested namespace """ return objToNestedNs(self.getObj())
def get(self): """ return deployment object """ return objToNestedNs(self._deployment)
def _getServiceNameFromFile(self, file): serviceYaml = self._getServiceYaml(file) return objToNestedNs(serviceYaml).metadata.name
def _getOverlayUuidFromYaml(self, deploymentYaml): return objToNestedNs(deploymentYaml).metadata.labels.overlayUuid
def _getAppNameFromYaml(self, deploymentYaml): return objToNestedNs(deploymentYaml).metadata.labels.app
def _hasValidProject(self, file): deploymentYaml = self._getDeploymentYaml(file) project = objToNestedNs(deploymentYaml).metadata.namespace return project == self._ctx.cf.ocp.project