After getting all of the emails that Container Registry is going away, I’m trying to update my legacy Google Cloud Function (1st gen) to use Artifact Registry (instead of Container Registry).
I followed the instructions to use the cloud console to edit the function, go to “Security and Image Repo”, change the “Image repository: Container location” to “Google managed Artifact Registry”, and continued to deploy the function. However, once the function finishes deployment, when I return to the “Security and Image Repo” section, I can see that “Google Container Registry” is still selected under “Container location”. (Also, under Details > Equivalent Rest, it still has “buildConfig”.“dockerRegistry”: “CONTAINER_REGISTRY”.)
Does this mean it silently failed to update to Artifact Registry? What is wrong and how can I move my function to Artifact Registry?
I looked at the logs and do not see any errors or warnings.
I checked permissions and the service worker has full “Editor” permissions including artifact registry read/write.
I am only using Cloud Functions and Firebase and had no knowledge of Container Registry until they started sending the emails that it is going away.
That’s strange. Can you try to find Artifact Registry in your GCP console and see if an image was auto-created for you?
It’d be tough to help you debug without knowing more information about your project. I think you should also open a support ticket at the same time so we can dive into more ofyour project details if we need to
No, you don’t need to create the repository again. You can run the migration command directly from Google Cloud Shell where the gcloud command is already installed.
Oh, that’s good to know. I also wasn’t able to find much information about how the migration command will affect my cloud functions. Will they continue working exactly the same as before? Or will they have a new URL or need other changes? I’m trying to avoid any downtime for my customers.
It asked to create 4 separate repos for different geographic areas. I never had anything like that with my old cloud functions. And when I create brand new cloud functions (2nd gen) with default settings, they don’t create multiple repos for different geographic areas. I don’t want all that extra complexity in my project. I thought cloud functions were supposed to be simple! So now I don’t trust the migrate command.
Instead I decided to create new (2nd gen) cloud functions and just copy over the code and settings from my old cloud functions. Then delete the old functions so I can make yet another copy using the same names as the old functions in order to get the same URLs that my applications expect. Then delete the intermediate copies. This involves an annoying amount of manual labor and a few minutes of downtime, but the new functions work fine. I wish Google just had a button to upgrade simple cloud functions like this to the latest version of their stack (or upgraded it automatically). This whole thing is such a waste of my time. But I will continue down this path unless someone can recommend a better option.
Slightly more efficient, but without upgrading to 2nd gen functions, this also worked:
In the cloud console, “…” menu actions > “Copy function” to create a temporary copy
Delete the original function
Copy the temporary function and use the original function’s name, being sure to select the “Google managed Artifact Registry” option
Delete the temporary function
This has the same effect as my original goal of simply editing the function and choose “Google managed Artifact Registry”. (Which kicked off this thread because that method appears to work, but silently fails.)