We run the risk of the state engine exiting early when a dependency is
not ready, especially in local mode. This changes forces a noop to be
returned when we are waiting on another service, which is the process
used elsewhere in the state engine.
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This function would usually check that an image is present for a
dependency, but in local mode the images would have never been inserted
into the database.
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
To avoid unnecesarilly using resources, we add an exponential backoff
when the noops explicitly come from the device-config module.
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
During the conversion to typescript, the VPN active check was being
performed on the directory, and not the file that the VPN creates,
meaning it would always return true (as we explicitly create the
directory on startup if it does not exist).
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
In the case of an airgapped supervisor, with a target state that
requests the vpn be enabled, the supervisor will constantly loop on
trying to set the vpn to on. Unfortunately the vpn requires an internet
connection to be configured, so it will never be turned on.
We add the concept of no-ops to the device-config state change steps,
and don't end the state engine transition while these are present
(similar to how image pulls are implemented).
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
When using the label `io.balena.features.balena-api` the supervisor will inject 2 environment
variables into the container:
- BALENA_API_KEY
- BALENA_API_URL
This allows the container to access the currently associated API using the KEY.
Change-type: patch
Signed-off-by: Rich Bayliss <rich@balena.io>
Connects-to: #847
The default value for the delta apply timeout was changed from `''` to
`'0'` (note strings as these are database values) - but if the value
existed in the database already, this would fail validation. We add a
migration which will look explcitily for the failing value and switch it
to the new default.
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This reverts commit 338ba4cdd7.
This is to unblock the release of the supervisor version, pending the
fix of the introduction of the race condition currently affecting v2
deltas.
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
Non-200 errors were causing the watchdog to restart the supervisor,
which in some cases could cause a restart loop. Instead we change the
code to only treat communication failures as an error, and report status
code failures directly.
Change-type: patch
Closes: #843
Signed-off-by: Cameron Diver <cameron@balena.io>