def fetch_image_names():
    'Fetches the image names by hitting the /api/kernelspecs endpoint of the Gateway.\n \n    For process-proxy kernelspecs, the image names are contained in the config stanza - which\n    resides in the process-proxy stanza located in the metadata.\n    '
    kspecs = None
    try:
        kspecs_response = get_kernelspecs()
        kspecs = kspecs_response.get('kernelspecs')
    except Exception as ex:
        logger.error('Got exception attempting to retrieve kernelspecs - retrying. Exception was: {}'.format(ex))
    finally:
        if (kspecs is None):
            return False
    images = set()
    for key in kspecs.keys():
        metadata = kspecs.get(key).get('spec').get('metadata')
        if (metadata is not None):
            process_proxy = metadata.get('process_proxy')
            if (process_proxy is not None):
                config = process_proxy.get('config')
                if (config is not None):
                    image_name = config.get('image_name')
                    if (image_name is not None):
                        images.add(image_name)
                    executor_image_name = config.get('executor_image_name')
                    if (executor_image_name is not None):
                        images.add(executor_image_name)
    for image_name in images:
        name_queue.put_nowait(image_name)
    return True
Fetches the image names by hitting the /api/kernelspecs endpoint of the Gateway.

For process-proxy kernelspecs, the image names are contained in the config stanza - which
resides in the process-proxy stanza located in the metadata.
def fetch_image_names():
    'Fetches the image names by hitting the /api/kernelspecs endpoint of the Gateway.\n \n    For process-proxy kernelspecs, the image names are contained in the config stanza - which\n    resides in the process-proxy stanza located in the metadata.\n    '
    kspecs = None
    try:
        kspecs_response = get_kernelspecs()
        kspecs = kspecs_response.get('kernelspecs')
    except Exception as ex:
        logger.error('Got exception attempting to retrieve kernelspecs - retrying. Exception was: {}'.format(ex))
    finally:
        if (kspecs is None):
            return False
    images = set()
    for key in kspecs.keys():
        metadata = kspecs.get(key).get('spec').get('metadata')
        if (metadata is not None):
            process_proxy = metadata.get('process_proxy')
            if (process_proxy is not None):
                config = process_proxy.get('config')
                if (config is not None):
                    image_name = config.get('image_name')
                    if (image_name is not None):
                        images.add(image_name)
                    executor_image_name = config.get('executor_image_name')
                    if (executor_image_name is not None):
                        images.add(executor_image_name)
    for image_name in images:
        name_queue.put_nowait(image_name)
    return True