Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update os-config to support custom delta server #1589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcaputo-harmoni
Copy link

Changes needed to support custom delta servers such as this. Needed because supervisor defaults to delta.balena-cloud.com otherwise.

@thgreasi
Copy link
Member

thgreasi commented Apr 1, 2024

Hi,
Even though the supervisor does have a default for https://delta.balena-cloud.com
https://github.com/balena-os/balena-supervisor/blob/4596149d0e1e7922c94ea8066725b7659976613d/src/config/schema-type.ts#L25C13-L25C43
the supervisor does try to first fetch the deltaEndpoint from config.json:
https://github.com/balena-os/balena-supervisor/blob/4596149d0e1e7922c94ea8066725b7659976613d/src/config/schema.ts#L17

As a result, once you have properly configured DELTA_HOST on your open-balena-api, newly provisioned devices should already start up with the correct, custom provided deltaEndpoint. Can you confirm that?

It would be great if we could avoid hardcoding balena-cloud.com in the open-balena-api's sources, and on top of that avoid the additional payload in the os-config endpoint for all non balena-cloud.com that this change would add.

@dcaputo-harmoni
Copy link
Author

@thgreasi thanks for the quick reply! Can you point me to the code where newly provisioned devices are assigned the deltaEndpoint variable in config.json? We are not seeing this happen and I was looking for somewhere where this was done automatically - but could not find it. In the end we decided to build the newer version (1.3.0) of os-config into our base OS to allow this to happen.

@thgreasi
Copy link
Member

Hi @dcaputo-harmoni and I'm sorry for the long delay on replying to this...

As long as the DELTA_HOST env var gets populated on the API container, then the device confg generation will start populating the deltaEndpoint field on the config.json files that it generates:
https://github.com/balena-io/open-balena-api/blob/v20.2.16/src/features/device-config/device-config.ts#L116
https://github.com/balena-io-modules/balena-device-config/blob/v6.3.0/lib/config.coffee#L89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants