File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,17 @@ def augment_labels(item: dict, labels: dict):
246246 item ["template" ]["metadata" ]["labels" ].update (labels )
247247
248248
249+ def notebook_annotations (item : dict ):
250+ nb_prefix = os .environ .get ("NB_PREFIX" )
251+ if nb_prefix :
252+ if "template" in item :
253+ if not "annotations" in item ["template" ]["metadata" ]:
254+ item ["template" ]["metadata" ]["annotations" ] = {}
255+ item ["template" ]["metadata" ]["annotations" ].update (
256+ {"app.kubernetes.io/managed-by" : nb_prefix }
257+ )
258+
259+
249260def write_components (
250261 user_yaml : dict ,
251262 output_file_name : str ,
@@ -341,6 +352,7 @@ def generate_appwrapper(
341352 )
342353
343354 augment_labels (item , labels )
355+ notebook_annotations (item )
344356
345357 if appwrapper :
346358 add_queue_label (user_yaml , namespace , local_queue )
You can’t perform that action at this time.
0 commit comments