With the new build process for functions, we need to slightly adapt our current code to handle the download of a function image.
Currently, we assume that the workload attribute rootfs contains a PSU to download the function image. But this is a real issue, as the PSU have an expiry.
The registry is now responsible to build functions and to deliver PSU for accessing functions images. That said, there is a route on the registry /v1/functions/{name} that will generate a PSU for the given function image, and return it to the caller.
Once the function workload is created, the url of the rootfs will be $URL_REGISTRY/v1/functions/{name}. The riklet should make a GET request on this endpoint to retrieve a PSU, and once retrieved, download the PSU like actual.
Description of the change
With the new build process for functions, we need to slightly adapt our current code to handle the download of a function image.
Currently, we assume that the workload attribute
rootfs
contains a PSU to download the function image. But this is a real issue, as the PSU have an expiry.The registry is now responsible to build functions and to deliver PSU for accessing functions images. That said, there is a route on the registry
/v1/functions/{name}
that will generate a PSU for the given function image, and return it to the caller.Once the function workload is created, the url of the rootfs will be
$URL_REGISTRY/v1/functions/{name}
. The riklet should make a GET request on this endpoint to retrieve a PSU, and once retrieved, download the PSU like actual.