Browse Source

[computes] Fixed the typo in picking compute display-name

Amit Srivastava 1 year ago
parent
commit
e806c01506
1 changed files with 3 additions and 2 deletions
  1. 3 2
      desktop/core/src/desktop/management/commands/sync_warehouses.py

+ 3 - 2
desktop/core/src/desktop/management/commands/sync_warehouses.py

@@ -110,9 +110,10 @@ def get_computes_from_k8s():
     try:
     try:
       namespace = n.metadata.name
       namespace = n.metadata.name
       LOG.info('Getting details for ns: %s' % namespace)
       LOG.info('Getting details for ns: %s' % namespace)
+      display_name = n.metadata.labels.get('displayName')
       item = {
       item = {
-        'name': n.metadata.labels.get('displayname', namespace),
-        'description': '%s (%s)' % (n.metadata.labels.get('displayname'), n.metadata.name),
+        'name': display_name if display_name else namespace,
+        'description': '%s (%s)' % (display_name, namespace) if display_name else namespace,
         'external_id': namespace,
         'external_id': namespace,
         # 'creation_timestamp': n.metadata.labels.get('creation_timestamp'),
         # 'creation_timestamp': n.metadata.labels.get('creation_timestamp'),
       }
       }