Skip to content

Commit

Permalink
Merge pull request #19 from mukrishn/index-env
Browse files Browse the repository at this point in the history
setting the index timestamp
  • Loading branch information
morenod authored Nov 29, 2023
2 parents 146e080 + 7727959 commit c19f0b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libs/platforms/rosa/hypershift/hypershift.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def create_cluster(self, platform, cluster_name):
else:
cluster_info['status'] = "installed"
cluster_end_time = int(datetime.datetime.utcnow().timestamp())
index_time = datetime.datetime.utcnow().isoformat()
# Getting againg metadata to update the cluster status
cluster_info["metadata"] = self.get_metadata(cluster_name)
cluster_info["install_duration"] = cluster_end_time - cluster_start_time
Expand Down Expand Up @@ -532,7 +533,7 @@ def create_cluster(self, platform, cluster_name):
self.logging.error(err)
self.logging.error(f"Failed to write metadata_install.json file located at {cluster_info['path']}")
if self.es is not None:
cluster_info["timestamp"] = datetime.datetime.utcnow().isoformat()
cluster_info["timestamp"] = index_time
self.es.index_metadata(cluster_info)
self.logging.info("Indexing Management cluster stats")
os.environ["START_TIME"] = f"{cluster_start_time_on_mc}" # excludes pre-flight durations
Expand Down
3 changes: 2 additions & 1 deletion libs/platforms/rosa/terraform/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def create_cluster(self, platform, cluster_name):
return 1
else:
cluster_end_time = int(datetime.datetime.utcnow().timestamp())
index_time = datetime.datetime.utcnow().isoformat()
break

cluster_info['status'] = "installed"
Expand Down Expand Up @@ -202,7 +203,7 @@ def create_cluster(self, platform, cluster_name):
self.logging.error(err)
self.logging.error(f"Failed to write metadata_install.json file located at {cluster_info['path']}")
if self.es is not None:
cluster_info["timestamp"] = datetime.datetime.utcnow().isoformat()
cluster_info["timestamp"] = index_time
self.es.index_metadata(cluster_info)

def _wait_for_workers(self, kubeconfig, worker_nodes, wait_time, cluster_name, machinepool_name):
Expand Down

0 comments on commit c19f0b1

Please sign in to comment.