How can I specify image name to spawner in pre_spawn_hook?

Hi All:
I have deploy jupyterhub with k8s and helm.
I want to specify image name that jupyterhub used to create container. I have asked this for gpt-3, and he gave me code below:


 def specify_image(spawner):
     spawner.profile_list = [ ]
     spawner.image = 'your_image_name'
 
 c.Spawner.pre_spawn_hook = specify_image

But I think these code can not work. Any help? Thanks.

You can specify the image name using singleuser.image.name and singleuser.image.tag: