Skip to content

Commit ce493a3

Browse files
committed
fix: apply suggestion from #1098
1 parent 4b396fd commit ce493a3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

scripts/migration/ray_cluster_migration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,17 +314,16 @@ def _remove_pre_upgrade_backup_annotation(
314314
plural="rayclusters",
315315
name=name,
316316
)
317-
annotations = dict(rc.get("metadata", {}).get("annotations") or {})
317+
annotations = rc.get("metadata", {}).get("annotations") or {}
318318
if PRE_UPGRADE_BACKUP_ANNOTATION not in annotations:
319319
return
320-
del annotations[PRE_UPGRADE_BACKUP_ANNOTATION]
321320
api_instance.patch_namespaced_custom_object(
322321
group="ray.io",
323322
version="v1",
324323
namespace=namespace,
325324
plural="rayclusters",
326325
name=name,
327-
body={"metadata": {"annotations": annotations}},
326+
body={"metadata": {"annotations": {PRE_UPGRADE_BACKUP_ANNOTATION: None}}},
328327
)
329328
except Exception as e:
330329
print(

0 commit comments

Comments
 (0)