Skip to content

Commit

Permalink
fix: only patch jupyter servers once in migration (#1994)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius authored and olevski committed Oct 16, 2024
1 parent e6461b7 commit 336fd09
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions resource_schema_migrations/migration_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ def adjust_annotations(args):
else:
print(f"No need to patch {js_name} for annotation {annotation_key}")

patch = {
"metadata": {
"labels": {f"{args.prefix}{config.SCHEMA_VERSION_LABEL_NAME}": "1"},
}
patch = {
"metadata": {
"labels": {f"{args.prefix}{config.SCHEMA_VERSION_LABEL_NAME}": "1"},
}
if len(annotation_patches.keys()) > 0:
patch["metadata"]["annotations"] = annotation_patches
if not args.dry_run:
k8s_api.patch_namespaced_custom_object(
group=args.group,
version=args.api_version,
namespace=args.namespace,
plural=args.plural,
name=js_name,
body=patch,
)
}
if len(annotation_patches.keys()) > 0:
patch["metadata"]["annotations"] = annotation_patches
if not args.dry_run:
k8s_api.patch_namespaced_custom_object(
group=args.group,
version=args.api_version,
namespace=args.namespace,
plural=args.plural,
name=js_name,
body=patch,
)

next_page = jss["metadata"].get("continue")
if next_page is None or next_page == "":
Expand Down

0 comments on commit 336fd09

Please sign in to comment.