return domains of internal apps
This commit is contained in:
parent
a2019a32d0
commit
fd28d5b774
3 changed files with 27 additions and 4 deletions
|
|
@ -33,14 +33,22 @@ class App(db.Model):
|
|||
if self.external:
|
||||
return self.url
|
||||
|
||||
# TODO: Get URL from Kubernetes
|
||||
return "unknown"
|
||||
# Get domain name from configmap
|
||||
ks_config_map = k8s.get_kubernetes_config_map_data(
|
||||
f"stackspin-{self.slug}-kustomization-variables",
|
||||
"flux-system")
|
||||
domain_key = f"{self.slug}_domain"
|
||||
if ks_config_map is None or domain_key not in ks_config_map.keys():
|
||||
return None
|
||||
|
||||
return ks_config_map[domain_key]
|
||||
|
||||
|
||||
def get_status(self):
|
||||
"""Returns a string that describes the app state in the cluster"""
|
||||
|
||||
if self.external:
|
||||
return("External app")
|
||||
return "External app"
|
||||
|
||||
|
||||
# TODO: Get some kind of caching for those values, as this is called
|
||||
|
|
|
|||
Reference in a new issue