Skip to content

Commit 5a0573e

Browse files
committed
chore(controller): use app uuid replace id
1 parent 62ceaa7 commit 5a0573e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

rootfs/api/management/commands/measure_networks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _measure_networks(self, app_map, timestamp):
2222
app_id = record["namespace"]
2323
owner_id = app_map[app_id].owner_id
2424
networks.append({
25-
"app_id": app_id,
25+
"app_id": str(app_map[app_id].uuid),
2626
"owner": owner_id,
2727
"name": record["pod_name"],
2828
"type": "network",

rootfs/api/models/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ def to_measurements(self, timestamp: float):
11621162
config = self.config_set.latest()
11631163
for container_type, scale in self.structure.items():
11641164
measurements.append({
1165-
"app_id": self.id,
1165+
"app_id": str(self.uuid),
11661166
"owner": self.owner_id,
11671167
"name": container_type,
11681168
"type": "cpu",
@@ -1171,7 +1171,7 @@ def to_measurements(self, timestamp: float):
11711171
"timestamp": int(timestamp)
11721172
})
11731173
measurements.append({
1174-
"app_id": self.id,
1174+
"app_id": str(self.uuid),
11751175
"owner": self.owner_id,
11761176
"name": container_type,
11771177
"type": "memory",

rootfs/api/models/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def detach_resource(self, *args, **kwargs):
230230

231231
def to_measurements(self, timestamp: float):
232232
return [{
233-
"app_id": self.app.id,
233+
"app_id": str(self.app_id),
234234
"owner": self.owner_id,
235235
"name": self.name,
236236
"type": self.plan,

rootfs/api/models/volume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def log(self, message, level=logging.INFO):
6565

6666
def to_measurements(self, timestamp: float):
6767
return [{
68-
"app_id": self.app.id,
68+
"app_id": str(self.app_id),
6969
"owner": self.owner_id,
7070
"name": self.name,
7171
"type": "volume",

0 commit comments

Comments
 (0)