@@ -248,18 +248,21 @@ def change_pod_manifest(self: KubeSpawner):
248248
249249 logging .info ("Setting user quota cpu/mem usage" )
250250
251- set_key_value (self , key = "cpu_guarantee" , value = float (user_quotas .get ("quota-ws-guaranteecpu" , self .cpu_guarantee )))
252- set_key_value (self , key = "cpu_limit" , value = float (user_quotas .get ("quota-ws-maxcpu" , self .cpu_limit )))
253- set_key_value (self , key = "mem_guarantee" , value = user_quotas .get ("quota-ws-guaranteemem" , self .mem_guarantee ), unit = "G" )
254- set_key_value (self , key = "mem_limit" , value = user_quotas .get ("quota-ws-maxmem" , self .mem_limit ), unit = "G" )
255- # check if there is an applicationHook defined in the values.yaml
256- # if so then execute the applicationHook function with "self" as parameter
257- #
258- # e.g.
259- # jupyterhub:
260- # applicationHook: "jupyter.change_pod_manifest"
261- #
262- # this will execute jupyter.change_pod_manifest(self=self)
251+ set_key_value (self , key = "cpu_guarantee" , value = float (user_quotas .get ("quota-ws-guaranteecpu" , self .cpu_guarantee )))
252+ set_key_value (self , key = "cpu_limit" , value = float (user_quotas .get ("quota-ws-maxcpu" , self .cpu_limit )))
253+ set_key_value (self , key = "mem_guarantee" , value = user_quotas .get ("quota-ws-guaranteemem" , self .mem_guarantee ), unit = "G" )
254+ set_key_value (self , key = "mem_limit" , value = user_quotas .get ("quota-ws-maxmem" , self .mem_limit ), unit = "G" )
255+
256+ # check if there is an applicationHook defined in the values.yaml
257+ # if so then execute the applicationHook function with "self" as parameter
258+ #
259+ # e.g.
260+ # jupyterhub:
261+ # applicationHook: "jupyter.change_pod_manifest"
262+ #
263+ # this will execute jupyter.change_pod_manifest(self=self)
264+
265+ if 'jupyterhub' in harness and harness ['jupyterhub' ]:
263266 if 'applicationHook' in harness ['jupyterhub' ]:
264267 func_name = harness ['jupyterhub' ]['applicationHook' ].split ('.' )
265268 logging .info (f"Executing application hook { func_name } " )
0 commit comments