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

patch: Replace legacy config RESIN_OVERRIDE_LOCK #1386

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

Conversation

vipulgupta2048
Copy link
Member

@vipulgupta2048 vipulgupta2048 commented Aug 10, 2023

Got a user mentioning the confusion of two configuration variables being present to enforce the override lock. Talking to @cywang117, it got clarified that resin_override_lock is legacy and balena_supervisor_override_lock is latest

The Docs is where the confusion started because Docs pulls these values directly from the API: https://docs.balena.io/reference/supervisor/configuration-list/raspberrypi3/

Hence, to fix the docs, we have to correct the variable name in the API and this is the PR doing just that.

Signed-off-by: Vipul Gupta (@vipulgupta2048) [email protected]

@vipulgupta2048
Copy link
Member Author

Thinking about this again, if there is a reason we have chosen to keep RESIN_OVERRIDE_LOCK around then I can handle this one on the docs with a simple if condition. LMK

@thgreasi
Copy link
Member

@vipulgupta2048 it looks like the SUPERVISOR_OVERRIDE_LOCK being in the block list and having the bC-api & the sdk using the RESIN_OVERRIDE_LOCK was intentional, so I think that we should (at least for now) stick with RESIN_OVERRIDE_LOCK
See:

// These env vars are allowed in the API but are set by other means
// (i.e. not directly as env vars from a frontend componenent).
// users must be blocked from setting them and they should be filtered out on display.
export const BLOCKED_NAMES = addReservedPrefixes([
'RESTART',
'DEVICE_RESTART',
'SUPERVISOR_OVERRIDE_LOCK',
'SUPERVISOR_NATIVE_LOGGER',
'HOST_LOG_TO_DISPLAY',
]);

See: https://github.com/balena-io/balena-api/blob/7e6d06fe8e75d7aee5a0f0079e0f21794acc7e14/src/features/devices/routes/lock-override.ts#L6
See: https://github.com/balena-io/balena-sdk/blob/4e54ae8a0daebbf85bd2ba48c9a522a96f5803ce/src/models/device.ts#L90

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