File tree 1 file changed +12
-0
lines changed
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):
246
246
item ["template" ]["metadata" ]["labels" ].update (labels )
247
247
248
248
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
+
249
260
def write_components (
250
261
user_yaml : dict ,
251
262
output_file_name : str ,
@@ -341,6 +352,7 @@ def generate_appwrapper(
341
352
)
342
353
343
354
augment_labels (item , labels )
355
+ notebook_annotations (item )
344
356
345
357
if appwrapper :
346
358
add_queue_label (user_yaml , namespace , local_queue )
You can’t perform that action at this time.
0 commit comments