Environment Variables Crossing Serverless Endpoints
I have a 3 endpoints that use the same serverless template then I update the docker image and env vars as needed.
My issue is the environment variables seem to sync between the 3 endpoints. ie I have value X that for endpoints should be A, B, C. But after setting them I can see the endpoints all have X=C.
6 Replies
i think i'm confused, how do you set the ENV and how do you read it?
Yes they're synced if you edit the template, all the others will sync
the way around this is to create different templates for each endpoint so they have independent values
I have an existing template:
worker-template
I create an endpoint with it and set some env vars
endpoint-1
I copy the endpoint and change the docker image it is using and set the same env var keys with different values
endpoint-2
I copy the endpoint again and change the docker image it is using and set the same env var keys with different values
endpoint-3
Then I go back and look at endpoint-1 and endpoint-2 and they have the same env var values as endpoint-3.
I never edit the template. I click "edit endpoint" for each of the updates to change the docker image and the env vars.
I just noticed that the docker image does the same thing as the env vars. So I guess "edit endpoint" is really "edit template" or something other than what I thought...
Yup I think it edits the template, so when you edit it via the "edit endpoint" if you go to the template that is used, does it change too?
If so, it's Wrong label, or they should change how this
@KingHarry
Escalated To Zendesk
The thread has been escalated to Zendesk!
Yes, it did change the template itself.
Odd, I guess my use case is not the intended one for templates and the copy endpoint functionality. I expected templates and copied endpoints to support distinct overrides for the templated values once the endpoint is created. Especially the env vars.
Is the main use case for templates and endpoint copies to change the worker infra options and regions?
Thanks for escalating - hopefully we can at least get the UI updated to make it clear you are editing the template for those fields and editing the endpoint for fields that are distinct per copy.
Your welcome, Endpoint syncs up with the template when updated, whether it's docker image, env csriable
The worker settings, region, Network storage is in endpoint itself I guess..
The fields you see in edit templates are synced